Closed lukeis closed 8 years ago
Make that confirmed that it is a bit random as to when it fails to get the screenshot.
I just now manually ran each version one at a time and each version was able to get
a screenshot this time.
It is possible that the error is due to a timeout issue. I had 10 copies of the same
test running through the hub at the same time, spread across 4 VMs and my desktop (all
the VMs are on the same system, as is the hub). I did notice one time running the
IE6 test from within my IDE that it failed to close the browser on the VM and that
was also a time when it did not grab a screenshot (which happens at the end of this
test just before I do the seleniun.stop() using my WebDriverBackedSelenium instance).
Hopefully this will clue someone in that knows the code as to what is going on.
Reported by lvskiprof
on 2011-09-08 22:06:02
I was just running some requested tests for 2426 and I got the error twice in a row
with IE7 where the screenshot fails and got to see it. I have noticed a few times
that when I run IE or Firefox (the only two I have seen this happen with so far) that
I sometimes never see the browser show up on the desktop of the system it is running
one, yet that test does run and completes successfully. All my test does is log onto
a web site and exit back out of it, verifying that you end up on the correct pages
as it goes.
What happened now is that I see the program finishing up, based on the status output
of the RemoteWebDriver server. But when I go to look for a screenshot in the results
web page created by TestNG methods in my code it is not there. So this must be tied
to times when the web browser is not showing up on the desktop, which is not 100% of
the time.
I think if you figure out why that happens you will have an explanation as to why screenshots
are failing sometimes, but not others.
Here is the status from the end of that test. It clicks a button to logout, waits
for the page title to change back to the login screen, and it is then supposed to capture
the screenshot and close the session:
09:13:59.264 INFO - Executing: [find element: By.selector: button] at URL: /session/1315584576666/element)
09:13:59.264 INFO - Done: /session/1315584576666/element
09:13:59.280 INFO - Executing: [click: 5 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@223be4]
at URL: /session/1315584576666/element/5/click)
09:13:59.389 ERROR - runtimeError: message=[The data necessary to complete thisoperation
is not yet available.] sourceName=[http://iiscf1a/scripts/jquery/jquery-1.5.1.min.js]
line=[16] lineSource=[null] lineOffset=[0]
09:13:59.389 WARN - getElementById(script1315584839389) did a getElementByName for
Internet Explorer
09:13:59.592 INFO - Done: /session/1315584576666/element/5/click
09:13:59.608 INFO - Executing: [get title] at URL: /session/1315584576666/title)
09:13:59.608 INFO - Done: /session/1315584576666/title
09:13:59.624 INFO - Executing: [get title] at URL: /session/1315584576666/title)
09:13:59.624 INFO - Done: /session/1315584576666/title
09:13:59.999 INFO - Executing: [delete session: 1315584576666] at URL: /session/1315584576666)
09:13:59.999 INFO - Done: /session/1315584576666
09:14:00.467 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@1dd1ed2
at URL: /status)
09:14:00.483 INFO - Done: /status
Here is one where the screenshot worked:
09:29:36.450 INFO - Done: /session/1315583763948/execute
09:29:36.465 INFO - Executing: [find element: By.selector: button] at URL: /session/1315583763948/element)
09:29:36.496 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@191e0eb
at URL: /status)
09:29:36.496 INFO - Done: /status
09:29:36.528 INFO - Done: /session/1315583763948/element
09:29:36.543 INFO - Executing: [click: 5 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@139cb14d]
at URL: /session/1315583763948/element/5/click)
09:29:36.668 INFO - Done: /session/1315583763948/element/5/click
09:29:36.668 INFO - Executing: [get title] at URL: /session/1315583763948/title)
09:29:37.059 INFO - Done: /session/1315583763948/title
09:29:37.059 INFO - Executing: [get title] at URL: /session/1315583763948/title)
09:29:37.075 INFO - Done: /session/1315583763948/title
09:29:37.465 INFO - Executing: [take screenshot] at URL: /session/1315583763948/screenshot)
09:29:38.012 INFO - Done: /session/1315583763948/screenshot
09:29:38.137 INFO - Executing: [delete session: 1315583763948] at URL: /session/1315583763948)
09:29:38.418 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@cb800f
at URL: /status)
09:29:38.418 INFO - Done: /status
Reported by lvskiprof
on 2011-09-09 16:31:43
How to use the logException function? And the logs are output on console or reporter?
Thanks
Reported by blusunrui
on 2011-09-13 07:24:36
The logs are output on both, except for the screenshot itself. I created the logBlankLine()
method because if you output to both the <br/> tag does not get interpreted, but gets
output literally. The version of Report.log() that goes only to the log itself is
able to properly handle HTML tags.
Reported by lvskiprof
on 2011-09-20 15:52:38
Looking at the logs from the remote server sessions, it looks like getScreenshotAs()
is never called at all in the session where you see no screenshot generated. Is it
possible this line of code is in an decision branch that's not getting executed?
Reported by james.h.evans.jr
on 2011-09-20 19:27:03
No that is not possible, because you see the message from the catch that says it was
not able to capture the screenshot.
I filed this bug after I saw this happen while I was running the test case manually
from within the IDE with the VM console in front of me. It happened when the browser
was never visible on the desktop console, yet the code was obviously running a browser
somewhere. I could see the status messages going by in the command line windows for
the server and all the tests passed. It is failing to get the screenshot, from what
I can see, because the browser is not visible on the desktop.
This is a rare event, but I saw it happen twice that day, and then I didn't see it
again. I have been doing updates with each new version and am currently locked in
with 2.5.0 and I have not seen this error in a while. I have 6 tests run every night,
but I don't always drill down to where the image would show up.
Reported by lvskiprof
on 2011-10-03 17:08:28
Reported by barancev
on 2011-10-13 09:05:10
Reported by jmleyba
on 2012-01-04 03:28:51
Hi!
i can not reproduce it at my Vista x32, ie9, selenium 2.32
Is it still reproducible?
2.0 is really old so please update to last selenium before reproducing.
Also please provide full exception info, grid hub&node configuration (cmd startup lines),
logs and test scenario.
My test code:
-------------------------------------------------------------------
public class Main {
public static void main(String[] args) {
Capabilities c = DesiredCapabilities.internetExplorer();
WebDriver driver = new RemoteWebDriver(c);
driver.get("http://localhost/www/screen/screen_too_long.html");
try {
WebDriver augemented = new Augmenter().augment(driver);
File file = ((TakesScreenshot) augemented).getScreenshotAs(OutputType.FILE);
} catch (Exception e) {
e.printStackTrace();
} finally {
driver.quit();
}
}
}
--------------------------------------------------------------------
Reported by a.u.savchuk
on 2013-05-06 17:53:16
NeedsClarification
Closing due to inactivity. Please ask to reopen if the issue is still actual.
Reported by barancev
on 2013-08-14 20:39:13
Fixed
Reported by luke.semerau
on 2015-09-17 18:13:39
Originally reported on Google Code with ID 2423
Reported by
lvskiprof
on 2011-09-08 18:26:11