Created
April 17, 2015 13:21
-
-
Save sahajamit/b67579a1670db8cb1df8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.android.NativeBrowserAutomation; | |
import io.appium.java_client.android.AndroidDriver; | |
import io.appium.java_client.remote.MobileBrowserType; | |
import io.appium.java_client.remote.MobileCapabilityType; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
/** | |
* Created by amit.rawat on 4/15/15. | |
*/ | |
public class TestAndroidNativeBrowser { | |
static AndroidDriver driver; | |
static DesiredCapabilities cap; | |
public static void main(String args[]) throws MalformedURLException { | |
DesiredCapabilities cap = new DesiredCapabilities(); | |
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator"); //in case of device pass the device id shown in adb devices | |
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"5.0.1"); | |
cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,300); | |
cap.setCapability(MobileCapabilityType.LAUNCH_TIMEOUT,"300000"); | |
cap.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.BROWSER); | |
driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"),cap); | |
driver.get("http://www.google.com"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment