Appium utility method to scroll till any element on a list or on screen | w3 actions
HTML-код
- Опубликовано: 1 авг 2024
- #appium_java_tutorial_qavbox #appium #java-client #mobiletesting #hybridapp #automationtesting #appiuminspector #android #scroll #swipe
This video will explain how to effectively Appium scroll till an element from a list / any element on screen | w3 actions and implement it as utility methods
TouchActions class is deprecated, so we need to use an alternate approach using Sequence class.
Appium java-client releases -
github.com/appium/java-client...
Sauce labs react mobile apps (Android and IOS ) -
github.com/saucelabs/my-demo-...
Complete tutorial - bit.ly/qav_appiumtutorial
code base - github.com/sunilpatro1985/App...
Subscribe to this channel -
bit.ly/youtube-qavbox
Blog posts -
qavalidation.com
Make me awake & feel fresh always, so I can bring lot's of interesting topics for you all, Buy me a coffee?
buymeacoffee.com/qavalidation
@qavbox how can we verify in horizontally left or right direction, i need to scroll and verify the list of menu aligned horizontal direction , can you please help me ,
Thanks. How can we get the list of all webelements with scroll down to the end of page?
This video explains how to scroll till end, so in each loop you van capture the items and append into list.
Let me know if you have any questions
Thanks for your video. By the way, function isEndOfPage(String pageSource) will not work in case the end element of page is a dynamic image. Because pageSource is still different from previous one although it is end of screen. How to deal with it?
Yes, a couple of scenarios we can't use this pagesource way of scrolling, can you identity that last dynamic element using contains or starts with XPATH? So you can scroll till the element is displayed instead of pagesource!
@@qavbox Also if devices are small or big screens then you must change SCROLL_RATIO dynamically (not fixed 0.5). If not, the element cannot be found. Have you ever used: findElement(new AppiumBy.ByAndroidUIAutomator(new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().resourceIdMatches("xxx"))))? It always RESETS scrolling up until locating at the top of screen before scrolling down to find the element?
Hi sir, How do we scroll till the end and click on or select multiple elements. The above is to scroll and click on single element.
Once you scrolled till the element, then clicking on single or selecting multiple elements are as usual
@@qavbox Thank you for the reply. Let me implement and check it out.
I saw u r some video its very confusing me ....i dont Why its hard to me ....may be its my fault ...
Scroll upto element, i got this code ---
driver.findElement(
new AppiumBy.ByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0))"
+ ".scrollIntoView(new UiSelector()" + ".textMatches(\"" + "Creating a post in new version " + "\").instance(0))"));
This above code is worked for me but i want scroll end of screen
using such type of script have u any alternative for that