How to Start the ChromeDriver execution without EULA?

0 votes

I am learning to use Selenium (V2.2.0) and these are some details on how this works. I'd like to uncover the pitfalls before they get there, and I've stumbled into one.

When I create my ChromeDriver, it always brings up a "Google Chrome EULA" and pops up two buttons: "Accept and Run" and "Cancel". I want this process to be automated without human intervention.

I referred this list of Chromium Command Switches but did not find any that worked, nor did any mention EULA. The test works fine if the user clicks "Accept and Run" and then let the code continue.

The code, up to the line that causes the problem, is below:

using (var driverService = ChromeDriverService.CreateDefaultService(@"C:\Apps\ChromeDriver\"))
{
    driverService.Start();

    // This line pops up the EULA
    IWebDriver driver = new ChromeDriver(@"C:\Apps\ChromeDriver\");

    // Test cases continued
}
}
Feb 28, 2019 in Selenium by Vaishnavi
• 1,170 points
37 views

1 answer to this question.

0 votes

You have this problem because the error occurs if you are opening up a brand new instance of the Chrome browser every time you run the test, thereby it triggers the EULA. If you copy the default Chrome profile to a custom location of your choice and then add the "--user-data-dir=yourcustomlocation" flag to ChromeOptions, you can bypass the EULA and open the existing profile instead.

ChromeOptions crOptions = new ChromeOptions();
crOptions.AddArgument(@"--user-data-dir=C:\custom location"); 
return new ChromDriver(crOptions);
answered Feb 28, 2019 by Surya
• 160 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

How to resolve the issue: Xpath for node without text but child has text

This will help you: //strong[not(normalize-space(text()))]/span[tex ...READ MORE

answered Jun 11, 2018 in Selenium by Samarpit
• 5,850 points
551 views
0 votes
1 answer

How to start Chromedriver in verbose mode on Eclipse

Hi friend, here is a script that ...READ MORE

answered Mar 20, 2019 in Selenium by Vaishnavi
• 1,170 points
110 views
0 votes
0 answers

How to configure ChromeDriver to initiate the browser in the Headless mode using Selenium?

I'm currently working on a Python script ...READ MORE

Apr 2, 2019 in Selenium by Surya
• 970 points
286 views
0 votes
1 answer

How to auto-refresh the ChromeDriver using Selenium Webdriver?

You can use this command. Also, refresh ...READ MORE

answered May 10, 2019 in Selenium by Vaishnavi
• 1,170 points

edited May 10, 2019 by Omkar 1,844 views
0 votes
0 answers

How to hide the console of the ChromeDriver in python

I'm currently using the chrome driver in ...READ MORE

May 15, 2019 in Selenium by Surya
• 970 points
745 views
+15 votes
18 answers

How can I convert String to JSON object in Java?

Hi @Daisy You can use Google gson  for more ...READ MORE

answered Feb 7, 2019 in Java by Suresh
• 700 points
103,479 views
0 votes
2 answers

How to convert a JSON String into Object in Java?

You could probably check out Google's Gson: ...READ MORE

answered Aug 21, 2019 in Java by Sirajul
• 44,350 points
668 views
0 votes
1 answer

How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?

You can use: new JSONObject(map); READ MORE

answered Jun 27, 2018 in Java by Akrati
• 3,150 points
2,453 views
0 votes
1 answer

How can we return a JSON object from a Java Servlet?

response.setContentType("application/json"); // Get the printwriter object from response ...READ MORE

answered Jul 6, 2018 in Java by sharth
• 3,370 points
2,177 views