Contents


GXtest UI commands - Edit Content

Official Content
This documentation is valid for:

This commands only apply when you want to set the content of HTML5 controls that are using a ContentEditable attribute. This particular case happens for example when using controls with type = FCK HTML Editor, the resulting HTML will use contenteditable = true. Actually, this article is being written on top of an FCK HTML Editor in GeneXus wiki.

For this kind of controls, instead of using traditional type commands, you will need to use the following ones.

EditContentByID

Sets the content of the specified element using its ID.

Parameters:

  • ID: the control's ID of the content. 
  • Text: A string containing the HTML context to set.

Example of use: 

&driver.EditContentById("content1", "<h2> this is the new sub-title </h2>")

EditContentByLinkText

Sets the content of an element, locating it by the text name:

Parameters:

  • LinkText: the link text to set the content. 
  • Text: A string containing the HTML context to set.

Example of use: 

&driver.EditContentByLinkText("edit this link here", "link edited")

EditContentByName

Sets the content of the specified element using its 'name' attribute.

Parameters:

  • Name: the NAME attribute of the control to set the content. 
  • Text: A string containing the HTML context to set.

Example of use: 

&driver.EditContentByName("content1", "text and text over here (html accepted)")

EditContentByCSS

Sets the content of the specified element using a CSS selector.

Parameters:

  • CSS: the CSS selector of the element that you want to set the content. 
  • Text: A string containing the HTML context to set.

Example of use: 

&driver.EditContentByCSS("body.cke_editable.cke_editable_themed.cke_contents_ltr.cke_show_borders","<pre>//Coding style here</pre>")

EditContentByXPath

Sets the content of the specified element using an XPath selector.

Parameters:

  • XPath: the XPath selector of the element to be edited.
  • Text: A string containing the HTML context to set.
Example of use: 

&driver.EditContentByXPath("//body", ,"<pre>//Coding style here</pre>")