Giter Site home page Giter Site logo

Comments (6)

kaelumania avatar kaelumania commented on August 17, 2024

scrollTo is not working with iOS 6.1/7.1 and how can i scroll to elements inside a UIWebView when in hybrid context?

from java-client.

jlipps avatar jlipps commented on August 17, 2024

in a webview context we're using the webdriver javascript atoms to get selenium webdriver functionality. and there is no scroll_to with this api. you should use javascript, just set window.scrollTop to the position of the element you want.

from java-client.

kaelumania avatar kaelumania commented on August 17, 2024

okay. can you please provide a few lines of sample code.

  • i tried "scrollTo", which will not work in webviews as you explained, but i does not work in ios native either.
  • i tried "mobile: scroll" via driver.executeScript, which worked in ios native, but got an not implemented exception in webview context

Furthermore shouldnt scrollTo be deprecated? Because it uses complexFind, which "is deprecated" according to the appium docs. Lastly, could you explain, what complexFind really does? i didnt find anything about that in the docs or code.

thanks.

from java-client.

jlipps avatar jlipps commented on August 17, 2024

Furthermore shouldnt scrollTo be deprecated?

Yes :-)

Lastly, could you explain, what complexFind really does? i didnt find anything about that in the docs or code.

Unfortunately I never had a good idea of what complexFind does. It was specifically for Android and has been superseded by the -uiautomator locator strategy. And it never worked in a mobile context anyway.

In terms of an example unfortunately I don't have time to put one together. But the key point is to use executeScript to run some javascript. You can look up how to use javascript to scroll a window, there's plenty of info online.

from java-client.

kaelumania avatar kaelumania commented on August 17, 2024

okay thanks, i will let you know, if i find a solution.

Are there any plans to put a real scroll method into the AppiumDriver class?
What does the "mobile: scroll" do behind the scenes? Is it javascript running in instruments and therefore does not work for webviews?

from java-client.

jlipps avatar jlipps commented on August 17, 2024

yes it uses a special instruments command that scrolls a view. the reason we have it is that swipe does not work on some views because the simulator has broken gesture recognition for some views.

from java-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.