Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extensions installed on chrome browser missing when chrome browser instance is opened with Selenium chromeDriver

I have a peculiar problem here. When I open chromeBrowser via chromeDriver the extensions that were previously installed are missing.Also the apps extension is getting deleted from extensions folder(AppData\Local\Google\Chrome\User Data\Default\Extensions).

Now when I open the chrome browser manually, the extension appear on the browser , also the apps folder in extensions folder (AppData\Local\Google\Chrome\User Data\Default\Extensions) no w appears back.

Below is version of chromedriver & browser. chromedriver version :26.0.1383.0 chromebrowser : 26.0.1410.64

like image 457
navger Avatar asked May 13 '13 21:05

navger


1 Answers

You have to install each extension you want to use. In Selenium2 C# API it looks like this

var options = new ChromeOptions();
options.AddExtension(Path.GetFullPath("local/path/to/extension.crx"));
var driver = new ChromeDriver(options);

and the extension will be in the browser. Reference for java can be found here. See this question for how to obtain the .crx file for your extension from the chrome store.

like image 200
craastad Avatar answered Oct 24 '22 05:10

craastad