0

i am trying to open webDriver with chrome extension (Modify header value) using below code

ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("/path/to/extension.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities); 

but this code is opening the webDriver instance with the extention in another window can any one know how to invoke it with chrome extension not in a new tab.

1 Answers1

0

You may refer with this thread. Be noted that Selenium supports interaction with web view only. You can check this tutorial on how to test your Chrome Extension with selenium. However, you can also use of sikuli (Automation tool that make use of image recognition), to click the chrome add-on. After that add-on popup will be another browser window, so use switch window to perform actions on add-on popup. Hope this helps!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59