Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to handle or remove warning of security in chrome through Selenium WebDriver?

    • 0
    • 5
    • 0
    • 2
    • 0
    • 0
    • 0
    • 0
    • 2.83k
    Comment on it

    Below is the error while run in chrome.

    alt text

    Use this code, it will always work

    System.setProperty("", YourChromePath);
      DesiredCapabilities capabilities =;
                ChromeOptions options = new ChromeOptions();
                capabilities.setCapability("chrome.binary", YourChromePath);
                capabilities.setCapability(ChromeOptions.CAPABILITY, options);

    Explanation of above code

    ChromeDriver() Use default host server configuration it creates a new chrome driver

    To resolve this above issue we use DesiredCapabilities and ChromeOptions. DesiredCapabilities gives you an options to customize and configure a browser session, here it customize chrome with the help of "chrome.binary" and ChromeOptions creates a new ChromeDriver instance with chrome "test-type" options instead of default host server configuration. To disable "unsupported command-line flags", we have to add Chrome argument "test-type" Later, with the help of Key "CAPABILITY" we store a set of ChromeOptions in a DesiredCapabilities object.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: