The first step after the starting the Appium server is to launch or invoke the installed application through the script. First we should set the desired capabilities and then launch the application.
DesiredCapabilities capabilites = new DesiredCapabilities();
capabilites.setCapability("device", "Android");
capabilites.setCapability("deviceName", "MOTOROLAXT1022");
capabilites.setCapability("platformVersion", "4.4.4");
capabilites.setCapability("platformName", "Android");
capabilites.setCapability("appPackage", "*****test package*****");
capabilites.setCapability("appActivity", "*****test activity*******");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilites);
Now, the desired application is invoked and you can start testing the application. You can also see the logs of launching the application in Appium logs and if you want, you can also save the logs to a file.
In the above code we are telling the Appium server that we are invoking the application on Android device and the name of device is MOTOROLAXT1022. We are using the Android version 4.4.4, so invoke all the APIs of this android version. The application that we want to launch is the "test package" and the screen that we want after the launching of application is the "test activity".
0 Comment(s)