Selenium ChromeDriver opens only the default chrome page

0 votes

I have recently been working with Selenium WebDriver. I am also working specifically with the ChromeDriver. Whenever I try to open a new chrome window (driver.get(URL)), Chrome starts the process in the default state, instead of opening on the current window from my dock (I am on a macbook running OS X Yosemite). Is there a way around this? Or is this just a set behavior?

Mar 5 in Selenium by Surya
• 970 points
48 views

1 answer to this question.

0 votes

You will see a default profile unless you specify which profile to use. To configure this in order to view the normal profile, navigate to chrome://version in a new tab. Your profile path is visible, and you can enter any specified option, by removing the "/Default" from the end of your path if any. Here's an example (this is for Windows, but the same code would work for Mac, just change the path)

    System.out.println("Now opening Chrome in my profile");
    ChromeOptions options = new ChromeOptions();
    options.addArguments("userdir=C:/Users/[your user name]/AppData/Local/Google/Chrome/User Data");

    driver = new ChromeDriver(options);
    driver.get("URL");
answered Mar 5 by Vaishnavi
• 1,160 points

Related Questions In Selenium

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,110 points
8,339 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
919 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,105 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
840 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 in Selenium by Vaishnavi
• 1,160 points

edited May 10 by Omkar 1,133 views
0 votes
1 answer