When you start a Web-driver using Selenium, It opens a new and very fresh instance of respective web browser ( looks as if just installed, no history and default settings}.
Is there any way to open usual windows which will have customized settings which I have done in my chrome or Firefox like add-ons and all ?
You can use existing profile in FireFox
File profileDir = new File("Path to default profile")
FirefoxProfile firefoxProfile = new FirefoxProfile(profileDir);
WebDriver webDriver = new FirefoxDriver(firefoxProfile);
For Chrome, you can go with options as below:
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome/User Data");
driver = new ChromeDriver(options);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With