Thursday, 23 June 2016

Appium - Selenium Java - Launching a URL

*****************For Beginners*****************

This post help you to understand how to set the capabilities to the automation test.

Capabilities have the power to mold the execution i a way that you want.

here are huge number of capibilities that appium offer to us, obviously the capabilities are different depend upon the OS that you are using.

Below are the simple code to open browser in the virtual device(Assuming Virtual device are already configure and connected)

DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("browserName","Browser");
    capabilities.setCapability("platformName","Android");
    capabilities.setCapability("deviceName","Android Emulator");
    capabilities.setCapability("automationName","selendroid");
    capabilities.setCapability("deviceName","Custom Phone - 4.1.1 - API 16 - 768x1280");
  
   
WebDriver Driver1 =  new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    Driver1.get("http://www.google.com");
    Driver1.Quit;





No comments:

Post a Comment