Lunching Chrome Browser in Real Device

TestNG test to lunch Chrome Browser in Real Device:

Code:

 

package com.test.testBrowser;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

public class NewTest {
@Test
public void testMyBrowser() throws MalformedURLException {

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“automationName”, “appium”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“platformVersion”, “5.0.2”);
capabilities.setCapability(“deviceName”, “”); //LGD41062815747
capabilities.setCapability(“app”, “chrome”);

URL seleniumGridUrl = new URL(“http://127.0.0.1:4723/wd/hub”);

//start up an AppiumDriver session
System.out.println(“Starting Appium Driver…”);
AppiumDriver ad = new AndroidDriver(seleniumGridUrl, capabilities);

System.out.println(“Driver Start : Done”);

}
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s