Home > Net >  Load Custom User Profile using Selenium and java in mac OS
Load Custom User Profile using Selenium and java in mac OS

Time:02-10

        System.setProperty("webdriver.chrome.driver" , "/Users/henry/Documents/POC/dc-qe-chrome-extension-test/ChromeExtensionAutomation/driver/chromedriver");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("user-data-dir=/Users/henry/Library/Application Support/Google/Chrome/Profile 4");
       // Tried to copy the profile data to different location as well
       // options.addArguments("user-data-dir=/Users/henry/Documents/POC/Profile 4");

        WebDriver driver = new ChromeDriver(options);
        driver.get("http://www.google.com");

Chrome browser opened but looks like it overrides the profile with default as after checking the chrome://version in the opened window it gives Profile path like below /Users/henry/Library/Application Support/Google/Chrome/Profile 4/Default

Please see the screen for reference. enter image description hereI have tried the same by copying all the Profile data to a different location but it didn't work either.

How can I load Profile 4?

Any suggestion here would be a great help. I have checked the below links before asking this: https://github.com/SeleniumHQ/selenium/issues/854

Load Default chrome profile with Webdriverjs Selenium

CodePudding user response:

  •  Tags:  
  • Related