Description
Send given text while an element is not found.
There are a fewKEY 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
| 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}
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.
Set Experitest Url
Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.
- For SeeTest cloud, EXPERITEST_URL needs to be https://cloud.seetest.io:443/wd/hub
- For Dedicated Experitest Lab, EXPERITEST_URL needs to be your own domain. e.g - https://company.experitest.com
Example
In following {BKSP} i.e. back will be sent to the device till the text 123 is found. As you can see the we do have 12345 as initial text and then 2 backspaces will be sent, since 123 will found this command will be successful.
DesiredCapabilities dc = new DesiredCapabilities(); driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), 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);