Ajay
Ajay

Reputation: 21

How to set set capability for chrome in selenium?

How to use this method? What parameter should I pass to "capabilityName" and "value"?

public void setCapability(java.lang.String capabilityName,java.lang.String value);

Upvotes: 2

Views: 4747

Answers (2)

Nobal
Nobal

Reputation: 75

Here is an example that maximizes the browser window (for chrome). Enable/Disable the second while running it and see the difference.

  ChromeOptions options = new ChromeOptions();
  options.addArguments("--start-maximized"); 
  WebDriver driver = new ChromeDriver(options);
  driver.get("http://www.google.com"); 

Upvotes: 2

olan
olan

Reputation: 3648

For Chrome specifically, you can find the capabilities here: https://sites.google.com/a/chromium.org/chromedriver/capabilities-aka-chromeoptions

There is a more general overview of capabilities on the selenium wiki: http://code.google.com/p/selenium/wiki/DesiredCapabilities

Upvotes: 4

Related Questions