|
|
|
|
|
|
|
Press on a certain element (ElementToClick) while another element (ElementToFind) is not found
Zone: Zone of elementToClick element
ElementToClick: query to identify the element to click.
ElementToClickIndex: Index of the element to click
ElemenToFind: query to identify the element which is looked for.
ElementToFindIndex: Index of the element to find
Timeout: Waiting Timeout in milliseconds
Delay: The time to wait between rounds
Scenario: In the following example we will use the EriBank demo application.
Step 1: Login to the application
Step 2: Click the Expense Report button
Step 3: We will use the add button to add Expense reports on the page
We want to add 4 reports before we stop.
Console log:
The result:
The add button was pressed 4 times until Expense: 4 was created.
client.pressWhileNotFound("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100);client.pressWhileNotFound("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100); self.client.pressWhileNotFound2("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100) $client->pressWhileNotFound2("NATIVE", "xpath=//*[\@text='Add']", 0, "xpath=//*[\@text='Expense : 4']", 0, 10000, 100);