GXtest UI Commands - Control Enabling

Official Content
This documentation is valid for:

This command is useful to check if a control is enabled on the page, without checking if it is visible or not.

This command returns true if the element is enabled and false if not, and can be executed using different locators (control name, id, name, CSS, XPath, or LinkText) as follows:

IsControlEnabled

image_2020102162321_1_png

Command useful to know whether a control is present and enabled or not.

Parameters

ControlName(Character): name of the control where options are contained

Example

&driver.IsControlEnabled("LoginButton")

IsElementEnabledByID

image_202010216185_1_png

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

Parameters:

  • ID: the HTML element ID .

Example of use: 

&driver.IsElementEnabledByID("InvoiceTotal")
 

IsElementEnabledByName

image_2020102161859_1_png

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

Parameters:

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

Example of use: 

&driver.IsElementEnabledByName("total")

IsElementEnabledByCSS

image_2020102161739_1_png

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

Parameters:

  • CSS: the CSS selector to the element. 

Example of use: 

&driver.IsElementEnabledByCSS("#vVAR1")

IsElementEnabledByXPath

image_2020102161921_1_png

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

Parameters:

  • XPath: the XPath selector to the element. 

Example of use: 

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

IsElementEnabledByLinkText

image_2020102161831_1_png

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

Parameters:

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

Example of use: 

&driver.IsElementEnabledByLinkText("Edit")