Creating the Appium Set up

Add a Java Class file under scenarios folder and name it AndroidSetup. Add the below content to the class file.


Explanation 

Installs the apk file (application) on the connected device from mentioned path,

start the application

Wait for Main Activity

inform the appium server which kind of session we are interested in (via Desired Capabilities)

give you the driver object which is of AndroidDriver type

Once you get the driver, from there on it's more like the Selenium usage of the appium driver and familiar method calls.


Write Login Script

The next logical step from here is to create Page class files for different pages in the app and then create an according test class file. However to test the code just written, you can write a small piece of code as below:



If you know the id of the Element look in to UIAutomatorViewer from ../sdk/tools/ directory.


Last modified: Tuesday, 24 March 2020, 3:19 PM