Appium(Java-Client) Migration V7 to V8 | Appium 8 | W3C Actions | Scroll | Swipe | Part 2
HTML-код
- Опубликовано: 11 июн 2022
- Appium v7-to-v8 Migration Guide :
Time
All methods that use TimeUnit class or where the time is passed as a simple numeric value were replaced with their alternatives using java.time.Duration class.
MobileElement
DefaultGenericMobileElement class has been removed completely together with its descendants (MobileElement, IOSElement, AndroidElement etc.). Use WebElement instead.
Touch Actions
The TouchAction and MultiTouchAction classes have been deprecated. The support of these actions will be removed from future Appium versions. Please use W3C Actions instead or the corresponding extension methods for the driver (if available). Check
SCROLL - THE BEHAVIOR
Set the event
Move finger into starting position
Determine scroll area dimensions
Determine the X&Y on screen
Finger comes in contact with the screen
Wait for a bit
Finger moves to position
Determine X & Y on screen
Speed
Finger moves up from the screen
Codebase : github.com/AutoInnoMation/App...
Part 1 : • Appium(Java-Client) Mi...
Other Appium Tutorials :
Tutorials 1 : • Appium Tutorial For Be...
Tutorials 2 : • Appium Tutorial For Be...
Tutorials 3 : • Create Test Automation...
#appium #automationtesting #selenium #testing #testautomation #automationtester
This session is awesome! It is properly explained and working solution. Very nice to such small videos with good step by step implementation.
thank you
Absolute lifesaver, thank you for the well explained example mate!
Very much needed this kind of explanation. TQ for doing this.
Glad it was helpful!
Thank you so much 🙏, I searched many websites but no use, finally this video resolved my issue.
You are welcome
Thank you so much!!! This worked
Glad it helped!
Hi Arnab, thank you for your help. Using the swipe gesture, how can I swipe a single position multiple times using a FOR cicle?
Thank you Arnab
Thank You
Thanks for the information... Can you please also add how to scroll to a particular element.. And also is there any other simple way to perform scroll actions.. This might be really helpful..
Do we have any examples for documentation to handle X Y Coordinates Screen Tap ( my goal is to control a custom android keyboard )
How we can scroll to particular element , could you please share the code for the same.
Hi Arnab, thanks for the video. Is there a way to swipe the screen without getting the element id? Like using driver can you perform swipe action?
Yes , you can use other locator strategies.
Hi Arnab, I’m facing issues in collecting server logs in appium v8.
driver.manage().logs().get(“logcat”) is not working in recent appium versions and throws unsupported command exception.
I understand that the error is because the GET call is being made to /session/:sessionid/se/log which is not the actual end point.
This should be /session/:sessionid/log, according to the docs. Have you faced this issue in your frameworks too while migrating. If so can you help me on resolving this
Hi Kabilan,
You are right. you can't use logcat in the latest appium. This happens because Java client v8 depends on Selenium4 and the latter has updated the corresponding API to fetch logs. On the server-side we also did add the new endpoint, but this change is only available since Appium2.
To resolve the issue follow these steps :
Step1: To Install Appium 2
npm install -g appium@2.0.0-beta.40
Step 2:To list all the available drivers in appium, enter the following command:
appium driver list
Step 3: To Install the driver
appium driver install uiautomator2
Step 4:Run Appium from the command line
Appium -a 127.0.0.1 -p 4723
Hope this will resolve your issue. Please let me know if you are having any issues while implementing this.
Please like, share, and subscribe.
Sir can you create a video on how to swipe by capturing two fixed x,y co-ordinates of a screen?
Haii sir ! How can I perform tap by coordinates using w3c actions?
I will try to create video on that
@@automationwitharnab8001 tq sir , please make the video on mobile gesture (tap , tap by coordinates) asap sir . Before that please share me the code sir !
Any update on this?
Any solution?
Hi Arnab
In case of the page object model - how do you define locators in object locator class incase of Appium java-client v8
@AndroidFindBy(accessibility = "emptyBagHeading")
@iOSXCUITFindBy(accessibility = "yourBag")
public MobileElement emptyBagHeading;
@AndroidFindBy(xpath = "//android.widget.Button[@content-desc='orders tab']/preceding::android.widget.TextView[2]")
//@iOSXCUITFindBy(xpath = "")
public MobileElement BagCountonBagTab;
Anyways from our first viedo i know we have use WebElement instead of MobileElement
Now you use @FindBy annotation instead of @AndroidFindBy and it returns a WebElement.
For PageFactory:
MyClass myClass = new MyClass(driver);
PageFactory.initelements(driver, myClass); // use the instant
hi for scrolling does any data need to filled in brackets
WebElement ele01 = driver.findElement(AppiumBy.id("com.roshnee.debug:id/action_bar_root"));
int centerX = ele01.getRect().x + (ele01.getSize().width/2);
double startY = ele01.getRect().y + (ele01.getSize().height * 0.9);
double endY = ele01.getRect().y + (ele01.getSize().height * 0.1);
Can you please give more details ? Can you please tell me about which bracket you are asking??