Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?