Skip to content

Mobile Device Commands

hekra01 edited this page Oct 30, 2014 · 5 revisions

WebDriver support mobile devices commands and is ported to mobile platforms Mobile device commands are implemented or emulated for all (QML/HTML/Widget) view types:

  • TouchClick - send QTouchEvent and QMouseEvent
  • TouchMove, TouchDown, TouchUp - send QTouchEvent;
  • TouchLongClick - emulated: show context menu;
  • TouchDoubleClick - emulated: zoom WebPage;
  • TouchScroll, TouchFlick - emulated: scrolling;
  • Orientation support
  • Multitouch support

See the below commands and org.openqa.selenium.qtwebkit.QtWebKitDriver.getMultiTouch()

/session/:sessionId/touch/-cisco-pinch-zoom
POST /session/:sessionId/ touch/-cisco-pinch-zoom
Simulates pinch zoom action
URL Parameters: 
    sessionId - ID of the session to route the command to
JSON Parameters: 
    x - X coordinate on the screen 
    y - Y coordinate on the screen 
    scale - zoom scale
Potential Errors: 
    StaleElementReference If the element referenced by:id is no longer attached to the page's DOM.
        
***
/session/:sessionId/touch/-cisco-pinch-rotate
POST /session/:sessionId/touch/-cisco-pinch-rotate
Simulates pinch rotate action
URL Parameters: 
    sessionId - ID of the session to route the command to. |
JSON Parameters: 
    x - X coordinate on the screen.
    y - Y coordinate on the screen.
    angle -rotation angle. |
Potential Errors: 
    NoSuchWindow-f the currently selected window has been closed.
    StaleElementReference-If the element referenced by :id is no longer attached to the page's DOM |
        
*** ### Support Matrix
Command HTML Widget Quick1 Quick2
/session/:sessionId/touch/click X X X
/session/:sessionId/touch/down X X X
/session/:sessionId/touch/up X X X
/session/:sessionId/touch/move X X X
/session/:sessionId/touch/scroll X X X
/session/:sessionId/touch/doubleclick X X X
/session/:sessionId/touch/longclick X X X
/session/:sessionId/touch X X X
/session/:sessionId/touch/flick X X X
/session/:sessionId/touch/-cisco-pinch-rotate X
/session/:sessionId/touch/-cisco-pinch-zoom X

See org.openqa.selenium.qtwebkit.QtWebKitDriver class for client side APIs.

Clone this wiki locally