Tag: Operation GOOGL DEX exit Server form index cap Tom
The code is as follows:
public static void Main (string[] args) {
try {
Androiddriver driver;
Desiredcapabilities cap=new desiredcapabilities ();
Cap.setcapability ("Automationname", "Appium");//appium do automation
Cap.setcapability ("App", "c:\\software\\jrtt.apk");//install APK
Cap.setcapability ("Browsername", "Chrome");//Set HTML5 Automation to open Google Chrome
Cap.setcapability ("DeviceName", "S4");//Device name
Cap.setcapability ("PlatformName", "Android"); Android Automation or iOS automation
Cap.setcapability ("Platformversion", "4.4"); Android OS version
Cap.setcapability ("Udid", "192.168.2.101:5555"); Udid of the equipment (ADB devices See)
Cap.setcapability ("Apppackage", "com.android.chrome");//package name of the app under test
Cap.setcapability ("Appactivity", "com.google.android.apps.chrome.ChromeTabbedActivity");//Entry activity name of the app being tested
Cap.setcapability ("Unicodekeyboard", "True"); Support Chinese input
Cap.setcapability ("Resetkeyboard", "True"); Support Chinese input, must be configured in two bar
Cap.setcapability ("NoSign", "True"); Do not re-sign apk
Cap.setcapability ("Newcommandtimeout", "40"); No new commands, appium30 seconds out
Driver= New Androiddriver (New URL ("Http://127.0.0.1:4723/wd/hub"), cap);//upload the above configuration to the Appium server and connect the phone
Implicit wait
Thread.Sleep (10000);
Driver.get ("https://www.baidu.com");
Thread.Sleep (10000);
Driver.findelementbyid ("index-kw"). SendKeys ("New Dream Software Test");
Driver.findelementbyid ("Index-bn"). Click ();
} catch (Exception e) {
Todo:handle exception
}
}
Appium testing, locating H5 elements (HTML5)