Home » appium-tutorial » Mobile WebApplication Automation with Appium

Newly Updated Posts

Mobile WebApplication Automation with Appium

Prevoius Topic, We are going to learn to perform Mobile WebApplication Automation with Appium, in this tutorial, but before we start let understand about WebApplication Automation.

What is WebApplication Automation in Mobile?

Web Application are the browser specific application, which are hosted in web with specific address or domain name. When we open the browser in mobile device and run our automation test, we call it as web application Automation testing in mobile device.

The mobile device has native applications, hybrid application along with have the provision to open the web application through browser. But to automate the web application is a bit different as what we performed earlier for mobile application.

The locator or the objects for mobile apps(native & hybrid) is different then the locators or objects in mobile web application because of different platform.

The locators in Mobile application is inspect in the same way as we did in Selenium, and also to create or execute the automation script for web application in mobile browser, we need to add few more capabilities .

How to perform Mobile WebApplication Automation with Appium?

To perform the Web apps automation, let consider a scenario and after writing the code, we will see, what are the capabilities are been added and setting performed.

Mobile WebApplication Automation with Appium


  • Open the facebook application in Mobile browser.
  • Under “Create an Account “, Enter first name and last name.


Note: There are few Reference variable that are predefined these are:

public static DesiredCapabilities capabilities=null;
public AndroidDriver adriver=null;
capabilities =new DesiredCapabilities();
capabilities.setCapability("platformVersion","9 PKQ1.181203.001");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");

try {
System.out.println("Opening the browser------------>");
adriver = new AndroidDriver(new URL(""), capabilities);
adriver.findElement(By.xpath("//input[@name='lastname']")).sendKeys("WebView Automation");

} catch (Exception e) {

Code Description of above code:

Step 1) Add the below capabilities on the Appium Automation script:

//Create the object of Desired Capability
capabilities =new DesiredCapabilities();
//Define the Device name
//Define the platform version
capabilities.setCapability(“platformVersion”,”9 PKQ1.181203.001″);
//Define Platform name
//provide the chrome driver exe path saved in local system with same version as the browser version in mobile device
capabilities.setCapability(“chromedriverExecutable”,”C:\Users\Girvar Singh Negi\Desktop\Eclipse_Installer\GeckoDriver\chromedriver.exe”);
//Define Browser name
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Chrome”);
//Define the string for chrome option

Step 2) Create the object the android Driver passing host, port number along with capabilities as a parameter

adriver = new AndroidDriver(new URL(“”), capabilities)

Step 3) Now open the facebook application on mobile browser


Step 4) Now inspect the element for first name using xpath and send the string “Code2tes.com” under First name text box


Step 5) Inspect the element for last name and send the string under last name text box and at the end close the browser.

adriver.findElement(By.xpath(“//input[@name=’lastname’]”)).sendKeys(“WebView Automation”); adriver.quit()


So with the below tutorial, we have learned how to automated the web browser application using mobile device and inspect and work with the element on mobile web.