IsElementFound( Zone, Text, Index)
|
|
|
|
|
|
|
Check if a given element or text is found in the specified zone; if found returns TRUE if not found returns FALSE
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
Scenario: 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
if(client.isElementFound("NATIVE", "xpath=//*[text='register']", 0)){// If statement}if(client.IsElementFound("NATIVE", "xpath=//*[text='register']", 0)){// If statement}If StrComp (client.IsElementFound ("NATIVE", "xpath=//*[text='register']", 0 ), "True") = 0 Then Report'If statementElse ReportEnd Ifif(self.client.isElementFound("NATIVE", "xpath=//*[text='register']", 0)):# If statementpassif($client->isElementFound("NATIVE", "xpath=//*[text='register']", 0)){# If statement}