Skip to content

Instantly share code, notes, and snippets.

@ckzgraphics
Created July 23, 2019 17:20
Show Gist options
  • Save ckzgraphics/ead589139dfb4d506ad85ff454c336ef to your computer and use it in GitHub Desktop.
Save ckzgraphics/ead589139dfb4d506ad85ff454c336ef to your computer and use it in GitHub Desktop.
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
public class Debug_Android_WebSiteOpen {
public static void main(String[] args) {
String HUB_URL = "http://localhost:4723/wd/hub";
AppiumDriver webDriver = null;
URL URLObj = null;
DesiredCapabilities capss = null;
String AUT_URL = "https://uidtest.accounts400.ondemand.com";
try {
URLObj = new URL(HUB_URL);
capss = new DesiredCapabilities();
capss.setCapability("platformName", "Android");
capss.setCapability("platformVersion", "9.0");
capss.setCapability("deviceName", "Nokia 7 Plus");
capss.setCapability("browserName", "chrome");
capss.setCapability("udid", "B2NGAA8822603421");
webDriver = new AndroidDriver(URLObj, capss);
webDriver.get(AUT_URL);
webDriver.getPageSource();
} catch (Exception e) {
e.printStackTrace();
} finally {
if(webDriver != null){
webDriver.quit();
}
} // CATCH END
} // FUNC END
} // CLASS END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment