GXtest UI Commands - Control Presence

Official Content

This command is useful to check if a control is present in the page, without checking if it is enabled and/or visible. This command returns true if the control is present and false if not.

IsControlPresent

IsControlPresent_png

Goal: To check if a control is present

Parameters:

  • ControlName: the control name as defined in the KB

Examples of use: 

&driver.IsControlPresent("CustomerPassword")
&driver.IsControlPresent("button3")

Also, this command can be executed using different locators (id, name, CSS, XPath or LinkText) as follows:

IsElementPresentByID

image_2020929164622_1_png

Goal: To check if an element is present using its ID.

Parameters:

  • ID: the element ID .

Example of use: 

&driver.IsElementPresentByID("InvoiceTotal")
 

IsElementPresentByName

image_2020929164648_1_png

Goal: To check if an element is present using its 'name' attribute.

Parameters:

  • Name: the value of the NAME attribute of the element. 

Example of use: 

&driver.IsElementPresentByName("total")

IsElementPresentByCSS

image_2020929164549_1_png

Goal: To check if an element is present using its CSS selector.

Parameters:

  • CSS: the CSS selector to the element. 

Example of use: 

&driver.IsElementPresentByCSS("#vVAR1")

IsElementPresentByXPath

image_2020929164722_1_png

Goal: To check if an element is present using an XPath selector.

Parameters:

  • XPath: the XPath selector to the element. 

Example of use: 

&driver.IsElementPresentByXPath("//textarea[@id='vVAR1']")

IsElementPresentByLinkText

image_2020929164757_1_png

Goal: To check if an element is present using a LinkText selector.

Parameters:

  • LinkText: the link’s text of the element. 

Example of use: 

&driver.IsElementPresentByLinkText("Edit")