GXtest UI Commands - Control Visibility

Official Content

This command is useful to check if an element is visible on a webpage. 

Returns true if the element is visible and false if it is not.

IsControlVisible

IsControlVisible_png

Goal: To check if a control is visible.

Parameters:

ControlName: the name of the control as defined in the KB.

Example of use: 

&driver.IsControlVisible("Price")

 

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

IsElementVisibleByID

image_2020929181029_1_png

Goal: To check if an element it’s visible using its ID.

Parameters:

ID: the HTML element ID .

Example of use: 

&driver.IsElementVisibleByID("InvoiceTotal")

IsElementVisibleByName

image_2020929181122_1_png

Goal: To check if an element it’s visible using its 'name' attribute.

Parameters:

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

Example of use: 

&driver.IsElementVisibleByName("total")

IsElementVisibleByCSS

image_202092918101_1_png

Goal: To check if an element it’s visible using its CSS selector.

Parameters:

CSS: the CSS selector to the element. 

Example of use: 

&driver.IsElementVisibleByCSS("#vVAR1")

IsElementVisibleByXPath

image_2020929181213_1_png

Goal: To check if an element it’s visible using an XPath selector.

Parameters:

XPath: the XPath selector to the element. 

Example of use: 

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

IsElementVisibleByLinkText

image_2020929181056_1_png

Goal: To check if an element it’s visible using a LinkText selector.

Parameters:

LinkText: the link’s text of the element. 

Example of use: 

&driver.IsElementVisibleByLinkText("Edit")