Open GoogleCodeExporter opened 9 years ago
Facing the same issue.. Is this solved?
Thanks,
Original comment by rgr...@gmail.com
on 25 Aug 2014 at 3:43
Any update by now? Thank you.
sbhinge@shipco.com
Original comment by sbhi...@shipcocloud.com
on 11 Sep 2014 at 10:11
[deleted comment]
Hello All,
Have not found any solutions for the error but, we found an appropriate
solutions for capturing screen shot using java code on windows screen
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class screen2image
{
public static void main(String[] args) throws Exception
{
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(screenShot, "JPG", new File("D:\\screenShot.jpg"));
}
}
Santosh Bhinge (sbhinge@shipco.com)
Original comment by sbhi...@shipcocloud.com
on 22 Sep 2014 at 2:53
Hi,
the Above solution captures only the windows screen shot (Eclipse) ,it does
not capture the my application (web Page) screen shot during execution of
the Test scripts
Currently i am getting the following exception for the below method
execution, please guide me.
public static String captureScreenshot(WebDriver oBrowser)
{
File srcFile;
String
dstFileName=System.getProperty("user.dir")+"\\Results\\ErrorScreenShots\\"+Syste
m.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;
}
org.openqa.selenium.WebDriverException: disconnected: cannot take screenshot
from disconnected: not connected to DevTools
(Session info: chrome=37.0.2062.124)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 x86)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 62 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27
17:17:32'
System info: host: 'Gopal-PC', ip: '192.168.1.16', os.name: 'Windows 7',
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_40'
Session ID: 4d02d5a4c43f057980f0778c1e701614
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true,
browserName=chrome,
chrome={userDataDir=C:\Users\Gopal\AppData\Local\Temp\scoped_dir5668_3310},
rotatable=false, locationContextEnabled=true, version=37.0.2062.124,
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:652
)
at Datatable.Datatable.WriteToResult(Datatable.java:710)
at
Utility.ApplicationIndependent.clickObject(ApplicationIndependent.java:90)
at
Utility.ApplicationDependent.AUT_AddPatientInfo(ApplicationDependent.java:242)
at
TestScripts.TestScripts.qdw_CreatePatientwithInsurance(TestScripts.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Driver.DriverScript.main(DriverScript.java:43)
Original comment by prabhaka...@gmail.com
on 28 Sep 2014 at 2:55
Original comment by samu...@chromium.org
on 21 Feb 2015 at 12:18
Unable to reproduce issue in both Windows 7 and in Ubuntu 14.04 with
chrome:35.0.1916.114, chromedriver:2.9 and
chrome:41.0.2272.89, chromedriver:2.14
Below is sample code:
public static void main(String[] arg) {
System.setProperty(""webdriver.chrome.driver"",
""C:\\Java\\libs\\chromedriver.exe"");
ChromeOptions options = new ChromeOptions();
options.addArguments(""load-extensions=C:\\Java\\ChromeExtensions"");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(caps);
driver.get(""http://www.google.com"");
System.out.println(""OutputFile: "" + captureScreenshot(driver));
}
public static String captureScreenshot(WebDriver oBrowser) {
File srcFile;
String dstFileName = System.getProperty(""user.dir"")
+ ""\\Results\\ErrorScreenShots\\"" + ""\\1001_MethodName.png"";
try {
srcFile = ((TakesScreenshot) oBrowser)
.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File(dstFileName));
} catch (Exception e) {
e.printStackTrace();
}
return dstFileName;
}
Original comment by ssudunag...@chromium.org
on 17 Mar 2015 at 8:23
I am able to duplicate this problem at will using ruby with chromedriver.
Ruby 2.0.0-P598
Selenium 2.44.0
ChromeDriver 2.14.313457
using Atomshell to launch an html 5 application. Attaching capybara to it, and
executing
Capybara.save_screenshot('test.jpg')
Throws the exception:
Selenium::WebDriver::Error::UnknownError: unknown error: cannot get automation
extension
from unknown error: page could not be found:
chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.h
tml
(Session info: chrome=40.0.2214.91)
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Mac OS X 10.10.2 x86_64)
from
/Users/brian.carlson/.rvm/gems/ruby-2.0.0-p598@acorn/gems/selenium-webdriver-2.4
4.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
Original comment by Brian.Mi...@gmail.com
on 24 Mar 2015 at 4:26
please share your script
Original comment by ssudunag...@chromium.org
on 25 Mar 2015 at 5:57
Original comment by ssudunag...@chromium.org
on 26 Mar 2015 at 6:35
env setup for driver:
Capybara.register_driver :atom do |app|
# Assume local setup
caps = Selenium::WebDriver::Remote::Capabilities.chrome(
"chromeOptions" => {"binary" => atom_binary_path}
options = {
browser: :chrome,
desired_capabilities: caps
}
Capybara::Selenium::Driver.new(app, options)
end
end
Capybara.configure do |capybara|
capybara.default_wait_time = 20
capybara.default_driver = :atom
capybara.exact = true
end
Login method:
def login!()
fill_in('username', with: 'johndoe')
fill_in('password', with: 'something')
Capybara.save_screenshot('/path/login_page.jpg')
click_button("Login")
end
Original comment by Brian.Mi...@gmail.com
on 31 Mar 2015 at 8:49
prabhakargudi / Brian.Michael.Carlson
please try with latest versions of chromedriver:2.15 and chrome:v43 and let us
know if you still see the issue.
Original comment by ssudunag...@chromium.org
on 25 May 2015 at 9:08
We have faced some issue with chrome browser it's got resolved after deleting
unwanted extension(ref Screenshot).
Original comment by pmahendr...@gmail.com
on 24 Jun 2015 at 6:28
Attachments:
Brian.Michael.Carlson@
Ran below sample ruby code without capybara and able to capture screenshot
successfully.
Please try without Capybara and let us know if you still facing issue with
latest chromedriver:2.16
Sample Code:
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :chrome
driver.navigate.to 'http://www.google.com'
driver.save_screenshot('google.png')
driver.close
Original comment by ssudunag...@chromium.org
on 17 Jul 2015 at 10:31
I am facing the same issue using python: WebDriverException: Message: unknown error: cannot get automation extension E from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
I am getting the same error as @oliaLi but I am using protractor with selenium-webdriver. But I am not trying to take a screenshot, the error occurs for me whenever I use browser.manage()
Hi, im having the same problem too.. here's my issue:
Original issue reported on code.google.com by
prabhaka...@gmail.com
on 5 Jun 2014 at 1:41