ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Loading an extension over chrome browser #1041

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See http://goo.gl/ll2FvQ for common issues.

Issue Description:
Unable to load an extension w.r.t  chromedriver using the DesiredCapabilities 
object. Have tried both the methods given at below site.

https://sites.google.com/a/chromium.org/chromedriver/extensions

None of them is working, Have tried with Java.

Chrome browser getting launched but whatever extension trying to load is not 
getting loaded. tired of trying this.
please help me if anyone has resolved this

Original issue reported on code.google.com by naga.s...@gmail.com on 18 Feb 2015 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Loading an extension works as expected & as mentioned in the site
https://sites.google.com/a/chromium.org/chromedriver/extensions

You can also try the below code for your reference :-
Also, Attaching the crx file.

ChromeOptions options = new ChromeOptions();
options.addExtensions(new 
File("/usr/local/google/home/gmanikpure/Downloads/extension_1_0_13.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);

 driver.get("https://gmail.com/");
 Thread.sleep(2000); 

Robot rob = new Robot();

 // opens Black query box on the top of the page which confirms extension is loaded properly
 rob.keyPress(KeyEvent.VK_CONTROL);rob.keyPress(KeyEvent.VK_SHIFT);rob.keyPress(KeyEvent.VK_X);
 Thread.sleep(10);
 rob.keyRelease(KeyEvent.VK_CONTROL);rob.keyRelease(KeyEvent.VK_SHIFT);rob.keyRelease(KeyEvent.VK_X);

 Thread.sleep(2000);

 // here, we can see the extension which again confirms the proper loading of it
 driver.get("chrome://extensions/");

Please let us know if this helps you

Original comment by gmanikp...@chromium.org on 4 Mar 2015 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by gmanikp...@chromium.org on 30 Mar 2015 at 9:43