SeeTest Client - SendWhileNotFound
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 .
void sendWhileNotFound(toSend, zone, elementtofind, elementtofindindex, timeout, delay)
Description
Send given text while an element is not found.
There are a few KEY EVENTS (listed below) that can be used (such as the one in the following example)
Parameters
- To Send: Text To Send
- SeeTestAutomation - Zone: Select Zone
- Element to find: Select the Element to find
- Element to find index: Element to find index.
- Timeout: Waiting Timeout in milliseconds
- Delay: Time to wait before the next iteration (in milliseconds)
Usage
This command can be used in the navigation function, which will know how to identify the current location in the application and navigate to any other required page. This behaves as a recovery mechanism when a test fails.
Scenario: In the following example the starting point is the countries list page in the EriBank demo application. We will use the key event of {ESC}
until the 'Logout' button is found to get back to the homepage of the application.
Parameters:
- ToSend: Will be set to "
{ESC}
" - Zone: will be set to "NATIVE"
- ElementToFind: Will be set to text=Logout
- Element to find index: will be set to "0"
- Timeout: Waiting Timeout in milliseconds – will be set to "7000" (7 seconds).
- Delay: will be set to "1000" (1 second).
Result: {ESC}
will be sent 3 times until the logout button is identified. Once it has, the command will end and we will be able to click the logout button to get back to the login screen.
Key Events
- For the Home key use
{Home}
- For deleting text:
{BKSP}
- For unlocking and waking the device :
{UNLOCK}
- Closing the keyboard on the device:
{CLOSEKEYBOARD}
- Toggle orientation:
- For landscape:
{LANDSCAPE}
- For Portrait:
{PORTRAIT}
- For landscape:
Code Examples
Java Example
client.sendWhileNotFound("{ESC}", "NATIVE", "text=Logout", 0, 7000, 1000);
C# Example Expand source
client.sendWhileNotFound("{ESC}", "NATIVE", "text=Logout", 0, 7000, 1000);
VBScript Example Expand source
client.SendWhileNotFound "{ESC}", "NATIVE", "text=Logout", 0, 7000, 1000
Report
Python Example Expand source
self.client.sendWhileNotFound("{ESC}", "NATIVE", "text=Logout", 0, 7000, 1000)
Perl Example Expand source
$client->sendWhileNotFound("{ESC}", "NATIVE", "text=Logout", 0, 7000, 1000);