SeeTestAutomation - IsElementFound
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
IsElementFound(Zone, Text, Index)
Description
Check if a given element or text is found in the specified zone; if found returns TRUE if not found returns FALSE
Parameters
- Zone - Select Zone
- SearchElement - what to search for: select Element from the drop-down list OR (for OCR text identification) insert text into the empty box in the drop-down list
- Index - Element or text index
Usage
S****cenario: In the following scenario we will verify that the ‘Register’ button appears upon entering the ebay application.
-
Enabling the Object Spy to grab a unique native identifier for the ‘Register’ button.
-
By marking the button, we can get all the element's properties. By checking on the XPath filter, we can see that path=//*[@text='Register'] uniquely recognized the element.
-
Adding a command of isElementFound(Zone, Element, Index) command with the following parameters:
-
Zone: NATIVE
-
Element: xpath=//*[@text='Register']
-
Index: 0
-
Code Examples
Java Example
if(client.isElementFound("NATIVE", "xpath=//*[text='register']", 0)){
// If statement
}
C# Example Expand source
if(client.IsElementFound("NATIVE", "xpath=//*[text='register']", 0)){
// If statement
}
VBScript Example Expand source
If StrComp (client.IsElementFound ("NATIVE", "xpath=//*[text='register']", 0 ), "True") = 0 Then
Report
'If statement
Else
Report
End If
Python Example Expand source
if(self.client.isElementFound("NATIVE", "xpath=//*[text='register']", 0)):
# If statement
pass
Perl Example Expand source
if($client->isElementFound("NATIVE", "xpath=//*[text='register']", 0)){
# If statement
}