Geb has issues interacting with CEF

50 views
Skip to first unread message

Sergio Ferrer Gimeno

unread,
Jul 20, 2016, 8:47:54 AM7/20/16
to Geb User Mailing List
Hi, I use a Cucumber JVM-Geb-Selenium Framework and I decided to use it to test my CEF application. Everything works fine except when the CEF configuration includes the --off-screen-rendering-enabled parameter, which is mandatory to use in my application. In that case, a runtime error happens.
Any idea why this is happening?

Thank you.

PD: It only happens when I'm using Geb, I've tried different combinations like just Selenium.. Geb Selenium.. Cucumber Selenium and the only way it reproduces the error is when I use Geb.

Marcin Erdmann

unread,
Jul 21, 2016, 4:01:05 PM7/21/16
to Geb User Mailing List
Hi Sergio,

What is the runtime error that you're experiencing? Can you please provide a stacktrace?

Marcin

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/0328ddba-74e2-4850-93e3-6582acb2044a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Sergio Ferrer Gimeno

unread,
Jul 22, 2016, 4:17:43 AM7/22/16
to Geb User Mailing List
Hi!,
Thank you for your answer, if you don't mind I'll give you a link to the CEF forum where we are trying to solve the problem as well. There you can find stacktrace and more information. As you will see, at first I thought it was a Selenium problem and later I realised it wasn't.

https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=14334&p=31532#p31532

Thank you!

Marcin Erdmann

unread,
Jul 22, 2016, 4:31:56 AM7/22/16
to Geb User Mailing List
I'm not sure that this would be a Geb problem because from what I see in that thread the exception is thrown by chrome driver. Can you please send us the whole stacktrace in text? What you have there is just a screenshot of the first couple of lines....

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.

Sergio Ferrer Gimeno

unread,
Jul 22, 2016, 6:31:55 AM7/22/16
to Geb User Mailing List
> libcef.dll!ui::MakeAsyncCopyRequest(aura::Window * window, const gfx::Rect & source_rect, const base::Callback<void __cdecl(std::unique_ptr<cc::CopyOutputResult,std::default_delete<cc::CopyOutputResult> >),1> & callback) Línea 42 C++
libcef.dll!ui::GrabWindowSnapshotAsync(aura::Window * window, const gfx::Rect & source_rect, scoped_refptr<base::TaskRunner> background_task_runner, const base::Callback<void __cdecl(scoped_refptr<base::RefCountedBytes>),1> & callback) Línea 64 C++
libcef.dll!ui::GrabViewSnapshotAsync(aura::Window * view, const gfx::Rect & source_rect, scoped_refptr<base::TaskRunner> background_task_runner, const base::Callback<void __cdecl(scoped_refptr<base::RefCountedBytes>),1> & callback) Línea 77 C++
libcef.dll!content::RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) Línea 2110 C++
libcef.dll!content::RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo & latency_info) Línea 2090 C++
libcef.dll!content::RenderWidgetHostImpl::CompositorFrameDrawn(const std::vector<ui::LatencyInfo,std::allocator<ui::LatencyInfo> > & latency_info) Línea 2163 C++
libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const base::PendingTask & pending_task) Línea 53 C++
libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Línea 473 C++
libcef.dll!base::MessageLoop::DoWork() Línea 599 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Línea 174 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Línea 56 C++
libcef.dll!base::RunLoop::Run() Línea 36 C++
libcef.dll!base::Thread::Run(base::MessageLoop * message_loop) Línea 202 C++
libcef.dll!base::Thread::ThreadMain() Línea 257 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params) Línea 84 C++
kernel32.dll!BaseThreadInitThunk () Desconocido
ntdll.dll!RtlUserThreadStart () Desconocido

The screenshot shows the whole stacktrace displayed by VS2015 when the runtime error happens...

This is what the Geb-Maven project displays after the runtime.

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running GebishOrgSpec
Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 17935
Only local connections are allowed.
[411.306][SEVERE]: Unable to receive message from renderer
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 416.756 sec <<< FAILURE! - in Gebish
OrgSpec
can get to the current Book of Geb(GebishOrgSpec) Time elapsed: 413.436 sec <<< ERROR!
java.lang.RuntimeException: Unexpected result for screenshot command: null
at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:344)
at geb.report.ScreenshotReporter.writeReport(ScreenshotReporter.groovy:36)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:947)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:54)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:48)


Results :

Tests in error:
GebishOrgSpec>GebReportingSpec.cleanup:48->GebReportingSpec.report:54 » Runtime

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:18 min
[INFO] Finished at: 2016-07-22T12:28:49+02:00
[INFO] Final Memory: 17M/87M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-t
est) on project geb-maven-example: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\sergiofg\Desktop\GebProjects\geb-example-maven-master\target\surefi
re-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Marcin Erdmann

unread,
Jul 22, 2016, 6:47:03 AM7/22/16
to Geb User Mailing List
I'm not interested in .NET exceptions because we're dealing with JVM here.

Can you please change your test to extend GebSpec instead of GebReportingSpec and share the error you're getting then? When using the reporting spec the errors that happen during reporting overshadow the real failure.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.

Sergio Ferrer Gimeno

unread,
Jul 22, 2016, 7:57:13 AM7/22/16
to Geb User Mailing List
Hi

The error doesn't seem to happen when extending from GebSpec :O any idea why?.

Taking in account that my real project is based on your Cucumber-jvm /Geb github example... Is it the same problem?

Marcin Erdmann

unread,
Jul 22, 2016, 11:37:37 AM7/22/16
to Geb User Mailing List
The stacktrace suggests that there is an issue with the driver when taking screenshots for reporting. I don't know what this offscreen rendering thing you are using is but sounds like it might be related. Are you executing your tests on a real display or are you using some kind of display emulation?

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.

Sergio Ferrer Gimeno

unread,
Jul 27, 2016, 7:51:03 AM7/27/16
to Geb User Mailing List
It is actually... some kind of emulation. Off-screen-rendering is a mode in which what is being displayed is not the actual rendering but an snapshot that detects and sends the user interaction (mouse and keyboard events) to the browser, which is the one that refreshes that static "snapshot". So...
Reply all
Reply to author
Forward
0 new messages