Error "Test run failed: unable to create driver"

tomcat
firefox-esr
xvfb
firefox
selenium
Tags: #<Tag:0x00007fe7b1664090> #<Tag:0x00007fe7b166bef8> #<Tag:0x00007fe7b166bdb8> #<Tag:0x00007fe7b166bc78> #<Tag:0x00007fe7b166bb38>

#1

I’ve got the error Test run failed: unable to create driver Followed by a bunch of lines, with one containing

Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/opt/firefox/firefox) on port 7055

that ends with someting like

Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

What could I do ?


Not getting an audit
Not getting an audit
#2

Hello @nico,

You should verify the following things:

  1. You have well installed Firefox 31ESR (not a newer one), and you have the suitable architecture (either i686 which is 32bit, either x86_64 which is 64bit).
  2. Your XVFB server is started up. Verify with ps axf | grep -i xvfb. If not, fire a sudo service xvfb start
  3. You have no firewall blocking connections to port 7055 and following (till 7099 if I remember correctly)
  4. Grab your XVFB port from /etc/init.d/xvfb (should be :99" by default), then check you have the same version in your /etc/default/tomcat7, with a JAVA_OPTS ending with something like -Dwebdriver.firefox.bin=/opt/firefox/firefox -Ddisplay=:99

Hope this helps


#3

In addition those verifications, the one who worked for me is to start Tomcat as the user declared in the install script. Starting Tomcat in root didn’t work for me.
To complete the error description :
org.asqatasun.scenarioloader.exception.ScenarioLoaderException: java.lang.RuntimeException: Test run failed: unable to create driver.
at org.asqatasun.scenarioloader.ScenarioLoaderImpl.run(ScenarioLoaderImpl.java:217)
at org.asqatasun.service.ScenarioLoaderServiceImpl.loadScenario(ScenarioLoaderServiceImpl.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy154.loadScenario(Unknown Source)
at org.asqatasun.service.command.AbstractScenarioAuditCommandImpl.loadContent(AbstractScenarioAuditCommandImpl.java:118)
at org.asqatasun.service.AuditServiceThreadImpl.loadContent(AuditServiceThreadImpl.java:114)
at org.asqatasun.service.AuditServiceThreadImpl.run(AuditServiceThreadImpl.java:95)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Test run failed: unable to create driver.
at com.sebuilder.interpreter.TestRun.initRemoteWebDriver(TestRun.java:231)
at org.asqatasun.sebuilder.interpreter.TgTestRun.initRemoteWebDriver(TgTestRun.java:373)
at org.asqatasun.sebuilder.interpreter.TgTestRun.next(TgTestRun.java:181)
at com.sebuilder.interpreter.TestRun.finish(TestRun.java:160)
at com.sebuilder.interpreter.Script.run(Script.java:67)
at org.asqatasun.scenarioloader.ScenarioLoaderImpl.run(ScenarioLoaderImpl.java:206)
… 18 more
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/logiciels/firefox-31.4.0esr/firefox) on port 7055; process output follows:

(process:8842): GLib-CRITICAL **: g_slice_set_config: assertion ‘sys_page_size == 0’ failed
Error: cannot open display: :99

(process:8849): GLib-CRITICAL **: g_slice_set_config: assertion ‘sys_page_size == 0’ failed
Error: cannot open display: :99

CENTOS 7.5
Tomcat 7.0.76
10.2.7-MariaDB MariaDB Server in Docker Container
Asqatasun 4.0.3


#4

Hi,

Obviously, the xvfb service is not running. The firefox can’t be instantiated beacause the display :99 doesn’t exist.

Regards

Koj


#5

Here is a link to the documentation to explain, how to install and set-up xvfb

https://doc.asqatasun.org/en/10_Install_doc/Asqatasun-runner/prerequisites-runner.html#xvfb

Regards

koj