Selenium, "go to" and login cookies weirdness

25 views
Skip to first unread message

Florian Hars

unread,
Mar 19, 2014, 9:38:32 AM3/19/14
to scalate...@googlegroups.com
I started to use the scalatest selenium DSL with sbt to write some
tests for an existing web application. The overall structure
is that I have

FlatSpec with Eventually
with BeforeAndAfter with BeforeAndAfterAll
with ShouldMatchers with WebBrowser

for each module, each instantiated once with Firefox and with Chrome.
In the "beforeAll()" method I log in to the application, and in "before"
I "go to" the start page for each module and then run the tests from
there.

This works like a charm if I start the tests by typing "sbt test" into a
terminal (usually with the DISPLAY set to some xvnc4server display), or
if I start jenkins from a terminal and then call "sbt test" in a jenkins
build script.

But if I deploy jenkins under tomcat7 (and give the tomcat7 user write
permissions for its home directory, so the browsers actually run), the
tests only work up to the first "go to" (or goTo, that makes no difference)
call. That request will be submitted, too, but with a completely clean
slate, so the application sees this as a new, unauthenticated request and
serves up another login form. The behaviour is the same for firefox and
for chrome (chromium, actually).

Any ideas why "go to" behaves so differently if used by different users,
or what else may cause this behaviour?

Thanks, Florian.

Florian Hars

unread,
Mar 20, 2014, 6:04:28 AM3/20/14
to scalate...@googlegroups.com
On Wed, Mar 19, 2014 at 02:38:32PM +0100, Florian Hars wrote:
> Any ideas why "go to" behaves so differently if used by different users,
> or what else may cause this behaviour?

In the end, it was a one charater error: my jenkins build script inserted
a stray slash in http://localhost:8080//app and the application then
didn't quite recognize the request and got confused.

Sorry for the noise,
Florian.
Reply all
Reply to author
Forward
0 new messages