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.
Checks if a control is present
Parameters:
Examples of use:
&driver.IsControlPresent("CustomerPassword")
&driver.IsControlPresent("button3")
Checks if a control inside a grid or table is present
Parameters:
Examples of use:
&driver.IsControlPresent("CustomerPassword", 1)
&driver.IsControlPresent("webComp2.button3", 4)
Also, this command can be executed using different locators (id, name, CSS, XPath, or LinkText) as follows:
Checks if an element is present using its ID.
Parameters:
Example of use:
&driver.IsElementPresentByID("InvoiceTotal")
Checks if an element is present using its 'name' attribute.
Parameters:
Example of use:
&driver.IsElementPresentByName("total")
Checks if an element is present using its CSS selector.
Parameters:
Example of use:
&driver.IsElementPresentByCSS("#vVAR1")
Checks if an element is present using an XPath selector.
Parameters:
Example of use:
&driver.IsElementPresentByXPath("//textarea[@id='vVAR1']")
Checks if an element is present using a LinkText selector.
Parameters:
Example of use:
&driver.IsElementPresentByLinkText("Edit")