Re: session and path are nil in selenium-mode

Skip to first unread message

Curran Schiefelbein

Jun 19, 2010, 11:22:25 AM6/19/10
Hi all,

This is still driving me a little crazy, especially given the number
of webrat+selenium examples that contain the following line of code
(or similar):

# This is still an integration test, so we have access to the
# session state if we need it
assert_equal, session[:user], "Should have been logged in"

as Bryan Helmkamp's
seems to be down today)

Can someone with a little experience please confirm whether there is a
way to access this information when using selenium, or whether it is
locked up inside the real browser and inaccessible to webrat and the
test code? I've been poking around in the source code; path is defined
(but evaluates to nil), @controller is nil, and session is just plain
an undefined method. In the working (non-selenium) webrat test,
session and @controller are both defined. Again -- is this normal, or
did I put together a broken webrat+selenium configuration?


On Jun 6, 2:37 pm, Curran <> wrote:
> Hi,
> I'm trying to convert a simple user authentication test from rails
> mode (in which it passes) into selenium mode. The browser opens, goes
> to the right page, enters the right text in the right form... BUT some
> of the variables/methods available to the test in rails mode are not
> available in selenium mode, such as session and path. They evaluate to
> nil and the test breaks. Does anyone know why this might be happening?
> I haven't been able to find anything suggesting that the webrat api
> would change in the two different modes. But that's the only thing
> that's changed in my app. There's a concise example and my webrat
> config at
> Thanks,
> Curran

Reply all
Reply to author
0 new messages