Java-client updates

Just released v1.7.0

IMPORTANT CHANGE: The scrollTo() and scrollToExact() methods have been removed because they used the ComplexFind method, which is no longer part of appium. I wanted to release this update because new methods for appium that people want to use.

We will definitely re-add the scrolling methods, but first we have to implement another change:

PLANNED CHANGE TO JAVA-CLIENT: Some commands only work on iOS while others only work on Android. This is confusing and not well documented. We’re planning on making two new classes AndroidDriver and IOSDriver which will inherit from AppiumDriver. You can discuss your opinion of the change in this topic, or on github

Here’s rest of the changelog for the new release:

  • Removed scrollTo() and scrollToExact() methods because they relied on complexFind(). They will be added back in the next version!
  • Removed complexFind()
  • Added startActivity() method
  • Added isLocked() method
  • Added getSettings() and ignoreUnimportantViews() methods
2 Likes

Thanks for this update @Jonahss.
As you already mentioned scrollTo() is very useful utility and hope to have it integrated back with more stability very soon.

One observation I had this morning is - The formatting in the Javadoc @ http://appium.github.io/java-client/index.html?overview-summary.html is broken and making it little hard to use the documentation.

1 Like

Thanks for the info!

What will be the options to scroll to an specific element?

Also, is there any news about the swipe method?

@Neto18 are you referring to this issue: https://github.com/appium/java-client/issues/41 ?

What options would you like for scrollTo methods? Feel free to file a github issue on the project and we can discuss the implementation.

I’ll fix the javadoc. Not sure what happened there.

ScrollTo will definitely be back as soon as we do the refactor which splits it into two separate clients.

If you use scrollTo, you can just stay on the previous version, since the only additions are the commands mentioned above.

@RamS Javadoc fixed.

Thanks @jonahss … Its very neat now.

It will be great if the documentation is more descriptive. Currently I feel its very abstract.

As in the example below, its difficult to understand values “using” will take. If some explanation saying, String value having UISelector data will help.


public org.openqa.selenium.WebElement findElementByAndroidUIAutomator(String using)
Specified by:
findElementByAndroidUIAutomator in interface FindsByAndroidUIAutomator

i am trying to understand new APIs. From java doc, i am not getting clear info.
what is the usecase for these apis:
startactivity(), getSettings() and ignoreUnimportantViews().

Pull requests for documentation welcome!
The thing is, we usually add documentation to the main Appium project, and the clients aren’t documented as much. Maybe I’ll provide links there?

startActivity() - Used for starting a specific Android activity, with a specified intent.

getSettings() and ignoreUnimportantViews(): https://github.com/appium/appium/blob/master/docs%2Fen%2Fadvanced-concepts%2Fsettings.md

scrollToBottom and scrollToTop (of table).

ScollTo(By id & xpath)

Doesn’t work for me. It involves specifying an element that is not visible, which triggers an exception, which halts the tests and closes the simulator:

error: Unhandled error: TypeError: Cannot read property ‘status’ of undefined
at null. (/usr/local/share/npm/lib/node_modules/appium/lib/devices/ios/ios-controller.js:169:19)
at Object.cb [as callback] (/usr/local/share/npm/lib/node_modules/appium/lib/devices/ios/ios-controller.js:239:5)
at next (/usr/local/share/npm/lib/node_modules/appium/node_modules/async/lib/async.js:801:43)
at /usr/local/share/npm/lib/node_modules/appium/node_modules/async/lib/async.js:32:16
at null. (/usr/local/share/npm/lib/node_modules/appium/lib/devices/ios/ios.js:1273:36)
at Object.q.process [as _onImmediate] (/usr/local/share/npm/lib/node_modules/appium/node_modules/async/lib/async.js:809:21)

Related to the ScrollTo, I was trying to use that as a work-around for Swipe, but it won’t work for me because I’m trying to swipe on a slider. I’ll need and option to trace all the way from one point to the other. Probably ScrollTo won’t work for that.

Those exist @Neto18. You can draw touch actions which follow a path drawn between arbitrary points. Check out this image appium drew on a multi-touch paint program :smile:

@jonahss I need that!
Is it part of the Appium/WebDriver lib?
could you please give me some extra info related to that?

I think this is what you are looking for

1 Like

Yup. http://github.com/jonahss/appium-draws-its-logo I apologize in advance for the messy code :wink:

What is the roadmap for java-client ??

The roadmap right now is we will do another release as soon as this issue is resolved: https://github.com/appium/appium/issues/3960

Do you need it to be released sooner?

Are there features you need/want or bugs which are blocking you?