Can someone, tell me how to perform swipe and scroll on real device?
Hi bappichok
You must run the command executeScript and specify that you want to perform a swipe action.
Sintax:
driver.executeScript("client:client.swipeWhileNotFound(\"direction\", offset, time);
Example of doing a swipe up from the border of the screen for 500ms:
driver.executeScript("experitest:client.swipe(\"Up\", 0, 500)");
Parameters:
- Direction: The direction to do the swipe (UP, DOWN, LEFT, RIGHT)
- Offset: Position in the screen where the swipe starts
- Time: Duration of the swipe (lower = faster swipe)
Great answer!
Just one small correction the offset is the distance in pixel to start the swipe from depend on the direction. For example: If swipe is Up, the offset will be from the top of the screen. In case of 0 offset it will open the notifications screen:
https://docs.experitest.com/display/public/SA106/Swipe