Skip to main content

SwipeWhileNotFound

Description​

This command will swipe the screen in search of element. If found, the command will return true, allowing you to use it in an if-else construct.

Parameters

NameValueDescription
directionstringDirection to swipe:



Up, down, left, right
offsetintSwipe offset, the distance from the bottom of the screen in pixels
swipeTimeintSwipe Time, swipe round duration in milliseconds.
zonestringZone - Native, Web
elementToFindstringxpath of the element to find
elementToFindInexintindex of the element to find, if more than one element answers to the xpath query
delayintTime to wait before sending a command (in milliseconds), delay time between swipes
roundsintMaxium swipe rounds
clickbooleanTrue - click the element once it's found



False - don't click the element

Usage​

If your app requires scrolling up or down in search of an element to click on, you can test this activity using the swipeWhileNotFound command.

Example​

info

Replace <server> with the appropriate URL.

Usage of SwipeWhileNotFound Command

driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);


...
...


if(seetest.swipeWhileNotFound("Down", 0, 2000, "NATIVE", "xpath=//*[@text='order']", 0, 1000, 5, true))
{
// if statement
}