Working with web-apps
Web apps can be run on any device or platform; the only requirement is a web browser and an Internet connection. The best part is that you don't need to install web-apps on the device. They are generally designed with cross-browser compatibility in mind.
Web apps on Android
We are going to take an example of the Google search page.
In this section, we are going to take a look at how to load the native browser on an emulator and then type data in the Google search box. Initially, we will get the native browser as shown in following screenshot:
Perform the following steps to load the native browser on an emulator and then type data in the Google search box:
Update the desired capabilities in the
setup()
method to launch the native browser:caps.setCapability("avd","AVD_Nexus_4");// Mention the created AVD name caps.setCapability(MobileCapabilityType.BROWSER_NAME, "Browser");
Now, we need to navigate to https://www.google.com using the following command:
driver.get("https://www...