Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged
New issue 7441 by
prabhaka...@gmail.com:
org.openqa.selenium.WebDriverException: unknown error: cannot get
automation extension
http://code.google.com/p/selenium/issues/detail?id=7441
Step 1:
Selenium Version: 2.41
OS : Windows 7 Enterprise (64 bit)
Browser: Chrome
Chrome Version: 35.0.1916.114 m
Selenium : 2.41
If i try to capture screen shot using the following method
Method :
public static String captureScreenshot(WebDriver oBrowser)
{
File srcFile;
String
dstFileName=System.getProperty("user.dir")+"\\Results\\ErrorScreenShots\\"+System.getProperty("dateTimeVal")+"\\1001_MethodName_"+getDateTime("dd-MMM-yyyy")+"_"+getDateTime("hh-mm-ss")+".png";
try
{
srcFile=((TakesScreenshot) oBrowser).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File(dstFileName));
} catch(Exception e)
{
e.printStackTrace();
}
return dstFileName;
}
chromedriver displays the following exception
Starting ChromeDriver (v2.9.248315) on port 47313
org.openqa.selenium.WebDriverException: unknown error: cannot get
automation extension
from unknown error: page could not be found:
chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=35.0.1916.114)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.11 seconds
Build info: version: '2.42.0', revision: '5e82430', time: '2014-05-22
20:18:33'
System info: host: 'BLRWCNU3359448', ip: '10.205.50.199',
os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_40'
Session ID: 46f2d3583dfe52d8754f120315239c7c
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true,
browserName=chrome,
chrome={userDataDir=C:\Users\pgudi\AppData\Local\Temp\scoped_dir8544_30130},
rotatable=false, locationContextEnabled=true, version=35.0.1916.114,
takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false,
handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true,
webStorageEnabled=true, applicationCacheEnabled=false,
takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:611)
at
org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:321)
at
Utility.ApplicationIndependent.captureScreenshot(ApplicationIndependent.java:634)
at Datatable.Datatable.WriteToResult(Datatable.java:623)
at Utility.ApplicationDependent.AUT_Login(ApplicationDependent.java:118)
at Driver.DriverScript.main(DriverScript.java:18)
step 2:
I have updated the testscript as follows:
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=C:\\Users\\pgudi\\AppData\\Local\\Google\\Chrome\\Application\\35.0.1916.114\\Extensions");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
oBrowser=new ChromeDriver(capabilities);
and in this path
C:\Users\pgudi\AppData\Local\Google\Chrome\Application\35.0.1916.114\Extensions
I added the following files (Manually)
i.icon.png
ii.manifest.json (this file inturn has the following lines
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"
https://preview.dentalweb.com"
]
}
iii. external_extensions.json (this file exists bydefault,it has the
content as follows
// This json file will contain a list of extensions that will be included
// in the installer.
{
}
After performing above settings
I started running the script to capture screen shot,it works inconsistent
approach some time(in the same package) it captures screen shot and some
time (other package)it displays the following
exception
org.openqa.selenium.WebDriverException: disconnected: cannot take screenshot
from disconnected: not connected to DevTools
(Session info: chrome=35.0.1916.114)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 29 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27
17:18:15'
System info: host: 'BLRWCNU3359448', ip: '10.205.50.199',
os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_40'
Session ID: ce836198a83eb7174ead50c22125c634
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true,
browserName=chrome,
chrome={userDataDir=C:\Users\pgudi\AppData\Local\Temp\scoped_dir8740_4372},
rotatable=false, locationContextEnabled=true, version=35.0.1916.114,
takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false,
handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true,
webStorageEnabled=true, applicationCacheEnabled=false,
takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:610)
at
org.openqa.selenium.chrome.ChromeDriver.getScreenshotAs(ChromeDriver.java:172)
at
Utility.ApplicationIndependent.captureScreenshot(ApplicationIndependent.java:634)
at Datatable.Datatable.WriteToResult(Datatable.java:623)
at
Utility.ApplicationIndependent.createAndGetObject(ApplicationIndependent.java:342)
at
Utility.ApplicationIndependent.ifObjectExists(ApplicationIndependent.java:213)
at
Utility.ApplicationDependent.AUT_CloseAlertMessage(ApplicationDependent.java:179)
at Utility.ApplicationDependent.AUT_Login(ApplicationDependent.java:141)
at Driver.DriverScript.main(DriverScript.java:20)
Expected: install the Chrome Extensions in consistent approach
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings