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, 2019 in Selenium by Surya
• 970 points
5,180 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, 2019 by Vaishnavi
• 1,180 points

Related Questions In Selenium

+1 vote
2 answers
0 votes
1 answer
0 votes
2 answers

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

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
18,443 views
0 votes
2 answers

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,500 points
12,618 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,572 views
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,910 points
6,629 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,519 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,203 views
0 votes
1 answer

How to save the content on the page (full page) using Selenium WebDriver?

Selenium isn't designed to do this, you ...READ MORE

answered Jun 28, 2019 in Selenium by Vaishnavi
• 1,180 points
4,323 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