I am using selenium,cucumber and java for automation testing.
I have a requirement of installing a plugin to the chrome browser to open my application. This plugin I hav
I'm using Chrome 65.0 and Selenium 3.11.0
Steps :
Code :
public static void main(String[] args){
System.setProperty("webdriver.chrome.driver", "F:\\Automation\\chromedriver.exe");
String pathToExtension = "C:\\Users\\USER_DELL_2014_07\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 3\\Extensions\\bhlhnicpbhignbdhedgjhgdocnmhomnp\\2.0_0";
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=" + pathToExtension);
WebDriver driver = new ChromeDriver(options);
driver.manage().window().maximize();
}
That's it! You can use this code and chrome would be instantiated with the given extension
Please let me know if you have any concerns related to this.