SendWhileNotFound
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
Name | Value | Description |
---|---|---|
ToSend | String | These are typically key events. |
Zone | String with one of the following values * NATIVE * WEB * TEXT | Zones which define the way the element will be identified. |
ElementToFind | String | Identification of Element in the device screen. |
Element to find index | Integer | Element to find index |
Timeout | Integer | Waiting Timeout in milliseconds Example : 7000 for 7 seconds |
Delay | Integer | Delay in milliseconds |
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:
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.
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
In following {BKSP}
, that is, back, is sent to the device until the text 123 is found. 12345 is then initial text then 2 backspaces are sent. Because 123 will be found, this command will be successful.
SendWhileNotFound
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");
...
...
// Backspaces till the screen as text 123
seetest.sendWhileNotFound("{BKSP}", "NATIVE", "text=123", 0, 10000, 1000);