question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working scroll from one element to another as expected in Appium 1.9.1 using python client with the robotframework-appiumlibrary on the iOS 12

See original GitHub issue

The problem

Maybe it is not the issue, just improvement which needs to do.

To create automation tests on the mobile devices, I use robotframework and robotframework-appiumlibrary, appium python client.

Since iOS released 12 version, I set up the latest appium 1.9.1 and tried to run my tests on the real iOS 12 device. My tests were broken because the scroll(from one element to the another) didn`t work as expected. In the server appium I see response status of the request 200, but nothing happens on the device.

I asked advice @mykola-mokhnach and his advice helped, he said that need to add wait after the press in the TouchAction

I take on only appium-python and tried to scroll . action = TouchAction(self.driver) action.press(element1).wait(600).move_to(element2).release().perform(). It works on the iOS 12. But in the robotframework-appiumlibrary I can’t make this function. In the Library there is no such implementation

The function(scroll - which I use in my tests) in the robotframework-appiumlibrary used scroll function from Appium_Python_Client-0.28-py2.7.egg!/appium/webdriver/webdriver.py

Function scroll in the robotframework-appiumlibrary:

def scroll(self, start_locator, end_locator): el1 = self._element_find(start_locator, True, True) el2 = self._element_find(end_locator, True, True) driver = self._current_application() driver.scroll(el1, el2)

Function scroll in the Appium_Python_Client:

def scroll(self, origin_el, destination_el): :Args: - originalEl - the element from which to being scrolling - destinationEl - the element to scroll to :Usage: driver.scroll(el1, el2) “”" action = TouchAction(self) action.press(origin_el).move_to(destination_el).release().perform() return self

In this function there is no wait after function press, I think that here there is the issue which could not allow working function scroll correct in the robotframework-appiumlibrary

Environment

  • Appium version 1.9.1:
  • Xcode 10
  • Appium-Python-Client==0.28
  • robotframework-appiumlibrary==1.4.6
  • Python 2.7
  • Node.js version v9.11.1
  • iOS 12
  • Real device

Details

My Local Solution is: I took the Appium-Python-Client, found function scroll in the WebDriver Class and add the third argument duration and wait after press:

def scroll(self, origin_el, destination_el, duration): action = TouchAction(self) action.press(origin_el).wait(duration).move_to(destination_el).release().perform() return self

And Installed it. Then I took the robotframework-appiumlibrary and change the scroll function in the _TouchKeywords Class. In the robotframework-appiumlibrary I saw changes which I made in the Appium-Python-Client.

def scroll(self, start_locator, end_locator, duration): el1 = self._element_find(start_locator, True, True) el2 = self._element_find(end_locator, True, True) driver = self._current_application() driver.scroll(el1, el2, duration)

And Installed it.

In this case, scroll works on iOS 12 real device with that Environment which I use. Maybe it is not the good solution, but it works for me and now I am possible to test iOS 12.
If Somebody have the better solution, I wiil glad.

Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KazuCocoacommented, Oct 10, 2018

Maybe no. Apple framework also doesn’t provide such special feature.

Define the method by yourself using TouchAction (Or scroll) is better like https://kazucocoa.wordpress.com/2017/12/25/appiumandroidscrolling-to-an-element/ 's 2nd one (The article is Ruby though), I think.

1reaction
EzimetYusupcommented, Oct 8, 2018

@KazuCocoa is there a method to scroll the UITableView or UIScrollView all the way down to bottom from Top or from Bottom To Top ? or what’s the best way to do it for native apps? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to scroll in Appium using python - Support
Hi I want to know how to scroll in appium using python I have done it in Java ... According to this one,...
Read more >
How to scroll in Appium using python - Support
I'm attempting to scrollTo in a webview of a hybrid app and your suggested script doesn't appear to work. At least on my...
Read more >
Unable to locate an element with latest appium python client ...
Hi Team, I am working on automating the IOS and Android mobile apps using Appium, and Robot Framework. Recently I have upgraded the...
Read more >
iOS scrolling not stopping at desired specified element and ...
I tried to following code snippets to scroll to specific element on iPhone 6 having iOS 12.4 but it doesn't stop at desired...
Read more >
How to use scroll/swipe in Python (except from coordinates)
The problem I've investigated about swipe behaviour on appium/ruby_lib#461 . Then I found the difference behaviour between iOS(ios-driver, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found