Skip to main content

SeeTestAutomation- PressWhileNotFound

info

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 .

Description: 

 Press on a certain element (ElementToClick) while another element (ElementToFind) is not found

Parameters

  • 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

Example

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.

Code Examples

Java Example

client.pressWhileNotFound("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100);

C# Example Expand source

client.pressWhileNotFound("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100);

Python code snippet: Expand source

 self.client.pressWhileNotFound2("NATIVE", "xpath=//*[@text='Add']", 0, "xpath=//*[@text='Expense : 4']", 0, 10000, 100)

Perl code snippet: Expand source

 $client->pressWhileNotFound2("NATIVE", "xpath=//*[\@text='Add']", 0, "xpath=//*[\@text='Expense : 4']", 0, 10000, 100);