Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.05 KB

mobile_methods.md

File metadata and controls

52 lines (35 loc) · 1.05 KB

Cross platform mobile methods

Reset

Mobile reset will reset the app's state.

Ruby + appium_lib gem

mobile :reset

Ruby without the gem

@driver.execute_script 'mobile: reset'

Android mobile methods

KeyEvent

KeyEvent enables sending a keycode to Android.

Press the system menu button in Java.

HashMap<String, Integer> keycode = new HashMap<String, Integer>();
keycode.put("keycode", 82);
((JavascriptExecutor)driver).executeScript("mobile: keyevent", keycode);

Ruby + appium_lib gem

mobile :keyevent, keycode: 82

Ruby without the gem

@driver.execute_script 'mobile: keyevent', :keycode => 82

Mobile find

Java

See MobileFindJavaTest.java

Ruby + appium_lib gem

scroll_to 'Gallery'