ScalaTest + Play Problems with FirefoxFactory

88 views
Skip to first unread message

Mirko Stocker

unread,
Jun 29, 2015, 9:15:28 AM6/29/15
to scalate...@googlegroups.com
Hi,

I'm unable to run a very basic ScalaTest + Play test within Firefox. The
browser opens, but it doesn't load anything, and after a timeout the test
fails:

[info] ExampleSpec:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
aScript error:
jar:file:///usr/lib/firefox/browser/omni.ja!/components/nsBrowserGlue.js, line
1868: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff
(NS_ERROR_UNEXPECTED) [nsIAnnotationService.getItemsWithAnnotation]

(process:22735): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size
== 0' failed
1435565645034 addons.manager DEBUG Loaded provider scope for
resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1435565645035 addons.manager DEBUG Loaded provider scope for
resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeM
[..]
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
at
org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:195)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at
org.scalatestplus.play.FirefoxFactory$.createWebDriver(FirefoxFactory.scala:75)
at
org.scalatestplus.play.FirefoxFactory$class.createWebDriver(FirefoxFactory.scala:55)
at ExampleSpec.createWebDriver(ExampleSpec.scala:7)
at
org.scalatestplus.play.OneBrowserPerSuite$class.webDriver(OneBrowserPerSuite.scala:323)
at ExampleSpec.webDriver$lzycompute(ExampleSpec.scala:7)
at ExampleSpec.webDriver(ExampleSpec.scala:7)
at
org.scalatestplus.play.OneBrowserPerSuite$class.run(OneBrowserPerSuite.scala:361)
at ExampleSpec.run(ExampleSpec.scala:7)
at
org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:466)
at
org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:677)
at sbt.ForkMain$Run$2.call(ForkMain.java:294)
at sbt.ForkMain$Run$2.call(ForkMain.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[info] The OneBrowserPerTest trait
[info] - must provide a web driver !!! CANCELED !!!
[info] Was unable to create a Selenium FirefoxDriver on this platform.
(OneBrowserPerSuite.scala:333)
[info] ScalaTest


I initially thought that it must be my system (Linux, Firefox 38), but I'm
able to reproduce this on a Windows and Ubuntu (14.10, Firefox 35), so it
might not be my system after all. The code is here:

https://github.com/misto/helloworld-scalatest

Any ideas what could have caused this?

Cheers

Mirko

--
Mirko Stocker | mi...@stocker.email
Work: http://ifs.hsr.ch | http://infoq.com
Personal: http://misto.ch | http://twitter.com/m_st

Mirko Stocker

unread,
Jun 29, 2015, 11:30:19 AM6/29/15
to scalate...@googlegroups.com
Problem solved! I forgot to add the driver to my library dependencies:

"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.46.0",

Apparently it's important to not add this to the test-classpath only, i.e.
this will _not_ work:

"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.46.0" % "test",
Reply all
Reply to author
Forward
0 new messages