Skip to main content

Browser Setup

In order to start testing on a browser you need to specify the type of browser you want to test on.

NamePossible Values
<br/><br/>browserName<br/><br/><br/><br/>For iOS: Safari<br/><br/>

<br/><br/>For Android: Browser / Chromium / Chrome<br/><br/>

Following are the code samples in difference languages to use the capability.

info

Replace <server> with the appropriate URL.

Java

DesiredCapabilities dc = new DesiredCapabilities();
dc.setBrowserName(MobileBrowserType.CHROME);
driver = new AndroidDriver('<server>', dc);
driver.get("seetest.io");
info

Additional way to set the browser (Java)

dc.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.CHROME);

Python

dc = {}
self.dc['browserName'] = 'safari'
self.driver = webdriver.Remote('<server>', self.dc)
self.driver.get('seetest.io')

C Sharp

DesiredCapabilities dc = new DesiredCapabilities();
dc.SetCapability(MobileCapabilityType.BrowserName, MobileBrowserType.Chrome);
driver = new AndroidDriver('<server>', dc);
driver.Navigate().GoToUrl("seetest.io");

Ruby

desired_caps = {
caps: {
browserName: 'safari',
},
appium_lib: {
server_url: '<server>',
}
}
@driver = Appium::Driver.new(desired_caps, true).start_driver

@driver.get('seetest.io')