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,180 points
733 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[te ...READ MORE

answered Jun 11, 2018 in Selenium by Samarpit
• 5,910 points
4,369 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,180 points
1,367 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
1,784 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,180 points

edited May 10, 2019 by Omkar 13,714 views
0 votes
1 answer

How to hide the console of the ChromeDriver in python

Have you tried this one?  https://help.applitools.com/hc/en-u ...READ MORE

answered Feb 16, 2020 in Selenium by Klinsc
9,979 views
+17 votes
25 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
• 720 points
253,619 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
• 59,230 points
3,261 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,190 points
6,995 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
5,890 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP