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 #383

Merged
merged 1 commit into from
Jan 23, 2019
Merged

Handle no elementId #383

merged 1 commit into from
Jan 23, 2019

Conversation

john7doe
Copy link
Contributor

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

jsf-clabot commented Jan 22, 2019

CLA assistant check
All committers have signed the CLA.

@mykola-mokhnach
Copy link
Contributor

Thanks for the fix @john7doe .

Make sure the email for your local git profile, which you used to push this PR, is the same as it was set on the JSF page to address "not signed yet" problem.

Copy link
Contributor

@dpgraham dpgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @john7doe !

@imurchie
Copy link
Contributor

Can we at least acknowledge this is the work of @JonStoneman (#382)?

@john7doe
Copy link
Contributor Author

@mykola-mokhnach The CLA is signed now :-)

@dpgraham
Copy link
Contributor

Thank you @JonStoneman too!

@dpgraham dpgraham merged commit cda2724 into appium:master 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.

5 participants