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 in Selenium by Vaishnavi
• 1,120 points
25 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 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,130 points
272 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 in Selenium by Vaishnavi
• 1,120 points
57 views
0 votes
0 answers
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 in Selenium by Vaishnavi
• 1,120 points

edited May 10 by Omkar 358 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 in Selenium by Surya
• 990 points
205 views
+14 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 in Java by Suresh
• 700 points
71,933 views
0 votes
1 answer

How to convert a JSON String into Object in Java?

We can easily convert a JSON String ...READ MORE

answered Jun 8, 2018 in Java by parth295
• 4,600 points
254 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
1,687 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,320 points
1,419 views