Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle no elementId #382

Closed
wants to merge 1 commit into from
Closed

Handle no elementId #382

wants to merge 1 commit into from

Conversation

stoneman
Copy link

The elementId parameter is not specified in the Set Orientation definition:

http://appium.io/docs/en/commands/session/orientation/set-orientation/

Since the SetOrientation handler in espresso server requires an elementId parameter, the java-client's device.rotate(ScreeOrientation.LANDSCAPE) method produces errors like this...

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
                at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:915)
                at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:943)
                at io.appium.espressoserver.lib.model.Element.exists(Element.java:100)
                at io.appium.espressoserver.lib.model.Element.getViewInteractionById(Element.java:78)
                at io.appium.espressoserver.lib.handlers.SetOrientation.handle(SetOrientation.java:35)
                at io.appium.espressoserver.lib.handlers.SetOrientation.handle(SetOrientation.java:30)
                at io.appium.espressoserver.lib.http.Router.route(Router.java:277)
                at io.appium.espressoserver.lib.http.Server.serve(Server.java:65)
                at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
                at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
                at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
                at java.lang.Thread.run(Thread.java:761)

This PR modifies the SetOrientation handler to use onView(isRoot()) when elementId is not provided. Support for the elementId parameter should possible be removed entirely?

@jsf-clabot
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@stoneman
Copy link
Author

Closing as I can't sign that CLA

@stoneman stoneman closed this Jan 22, 2019
@imurchie imurchie mentioned this pull request Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants