anybody know why chrome arguments does't work?
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class testowa {
public static void main(String[] args) throws InterruptedException {
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setCapability("chrome.args",
Arrays.asList("--disable-web-security", "--start-maximized"));
WebDriver driver = null;
try {
URL hub_url = new URL("http://192.168.56.101:4444/wd/hub");
driver = new RemoteWebDriver(hub_url, capability);
} catch (MalformedURLException e) {
e.printStackTrace();
}
driver.get("file:///home/test/www/index.html");
}
}
I've tried also without "--" before switchers and giving only one argument... Chrome starts, but without activated flags.
I use newest chromedriver.
I recently discovered that the
Capabilities
class does not work properly with current Selenium and Chrome for some reason (as of Selenium 2.33.0, Chrome 30 and July 2013).The answer I linked is also, I believe, the solution to your problem. Simply use
ChromeOptions
, these have been working for me well:Those who are looking for .Net C# and Selenium, to load insecure script
Try something this, Change the path and slashing accoding to your specifications :-
Below is the link where all available chrome flags are listed :-
http://peter.sh/experiments/chromium-command-line-switches/