Skip to main content

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

NameValueDescription
ToSendStringThese are typically key events.
ZoneString with one of the following values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementToFindStringIdentification of Element in the device screen.
Element to find indexIntegerElement to find index
TimeoutIntegerWaiting Timeout in milliseconds



Example : 7000 for 7 seconds
DelayIntegerDelay 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.

info

Replace <server> with the appropriate URL.

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);