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.

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

Name

Value

Description

directionstring

Direction 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
clickboolean

True - 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

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.

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


...
...


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