I am encountering some inconsistent behaviour with selenium
When I run the following tests:
...
And I follow "Edit Account"
Then I should see "Account Edit Page"
When I fill in "Name" with "My New Name"
When I press "Save Account"
...
I get different pass and fails each time. Mainly when Capybara fails
to locate an element on the page. Sometimes it will find and follow
the link, sometimes not. It always seems to fail on form elements.
A selection of errors that I get:
cannot fill in, no text field, text area or password field with id,
name, or label 'user_name' found (Capybara::ElementNotFound)
no button with value or id or text 'Save Account' found
(Capybara::ElementNotFound)
no link with title, id or text 'Edit Account' found
(Capybara::ElementNotFound)
I tried scoping it using within but that fails too.
I know its working fine because the correct pages appear in the
selenuim controlled browser.
Can anyone help me out???
I am testing a Rails 2.3.5 with capybara (0.3.8), using with cucumber
cucumber (0.8.0)
On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote: > Hi,
> I am encountering some inconsistent behaviour with selenium
> When I run the following tests:
> ... > And I follow "Edit Account" > Then I should see "Account Edit Page" > When I fill in "Name" with "My New Name" > When I press "Save Account" > ...
> I get different pass and fails each time. Mainly when Capybara fails > to locate an element on the page. Sometimes it will find and follow > the link, sometimes not. It always seems to fail on form elements.
> A selection of errors that I get:
> cannot fill in, no text field, text area or password field with id, > name, or label 'user_name' found (Capybara::ElementNotFound)
> no button with value or id or text 'Save Account' found > (Capybara::ElementNotFound)
> no link with title, id or text 'Edit Account' found > (Capybara::ElementNotFound)
> I tried scoping it using within but that fails too.
> I know its working fine because the correct pages appear in the > selenuim controlled browser.
> Can anyone help me out???
My first line of attack for problems like this is to through in a
I'm having a similar problem.
A show me the page isn't much help unfortunately.
I see this issue on some very basic pages (i.e. no ajax), so the
elements are definitely present - indeed I can see them on the page.
Yet webdriver sometimes fails to locate the elements.
It is the inconsistency that is weird, and makes this difficult to
debug.
On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote:
> > Hi,
> > I am encountering some inconsistent behaviour withselenium
> > When I run the following tests:
> > ...
> > And I follow "Edit Account"
> > Then I should see "Account Edit Page"
> > When I fill in "Name" with "My New Name"
> > When I press "Save Account"
> > ...
> > I get different pass and fails each time. Mainly when Capybara fails
> > to locate an element on the page. Sometimes it will find and follow
> > the link, sometimes not. It always seems to fail on form elements.
> > A selection of errors that I get:
> > cannot fill in, no text field, text area or password field with id,
> > name, or label 'user_name' found (Capybara::ElementNotFound)
> > no button with value or id or text 'Save Account' found
> > (Capybara::ElementNotFound)
> > no link with title, id or text 'Edit Account' found
> > (Capybara::ElementNotFound)
> > I tried scoping it using within but that fails too.
> > I know its working fine because the correct pages appear in the
> > selenuim controlled browser.
> > Can anyone help me out???
> My first line of attack for problems like this is to through in a
> Then show me the page
> before the failing step.
> I'm having a similar problem. > A show me the page isn't much help unfortunately. > I see this issue on some very basic pages (i.e. no ajax), so the > elements are definitely present - indeed I can see them on the page. > Yet webdriver sometimes fails to locate the elements. > It is the inconsistency that is weird, and makes this difficult to > debug.
> On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote: >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote: >>> Hi,
>>> I am encountering some inconsistent behaviour withselenium
>>> When I run the following tests:
>>> ... >>> And I follow "Edit Account" >>> Then I should see "Account Edit Page" >>> When I fill in "Name" with "My New Name" >>> When I press "Save Account" >>> ...
>>> I get different pass and fails each time. Mainly when Capybara fails >>> to locate an element on the page. Sometimes it will find and follow >>> the link, sometimes not. It always seems to fail on form elements.
>>> A selection of errors that I get:
>>> cannot fill in, no text field, text area or password field with id, >>> name, or label 'user_name' found (Capybara::ElementNotFound)
>>> no button with value or id or text 'Save Account' found >>> (Capybara::ElementNotFound)
>>> no link with title, id or text 'Edit Account' found >>> (Capybara::ElementNotFound)
>>> I tried scoping it using within but that fails too.
>>> I know its working fine because the correct pages appear in the >>> selenuim controlled browser.
>>> Can anyone help me out???
>> My first line of attack for problems like this is to through in a
>> Then show me the page >> before the failing step.
ah, I'm running into the same thing, with :firefox and :chromium
causing the same not found behavior.
I'm finding that if I have a few page.should... checks, then it can't
find the element, but if I just do the find, it works. I've also
found that calling click('#continue-button') or click_link('#continue-
button') doesn't work, but calling find('#click-button').click
does...
this is all a bit odd and I'm not sure where to start to try and track
it down... but I'll keep looking! ;)
On Jul 3, 12:43 am, Matt Wynne <m...@mattwynne.net> wrote:
> > I'm having a similar problem.
> > A show me the page isn't much help unfortunately.
> > I see this issue on some very basic pages (i.e. no ajax), so the
> > elements are definitely present - indeed I can see them on the page.
> > Yet webdriver sometimes fails to locate the elements.
> > It is the inconsistency that is weird, and makes this difficult to
> > debug.
> Must be a timing issue then. Which browser?
> > On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote:
> >>> Hi,
> >>> I am encountering some inconsistent behaviour withselenium
> >>> When I run the following tests:
> >>> ...
> >>> And I follow "Edit Account"
> >>> Then I should see "Account Edit Page"
> >>> When I fill in "Name" with "My New Name"
> >>> When I press "Save Account"
> >>> ...
> >>> I get different pass and fails each time. Mainly when Capybara fails
> >>> to locate an element on the page. Sometimes it will find and follow
> >>> the link, sometimes not. It always seems to fail on form elements.
> >>> A selection of errors that I get:
> >>> cannot fill in, no text field, text area or password field with id,
> >>> name, or label 'user_name' found (Capybara::ElementNotFound)
> >>> no button with value or id or text 'Save Account' found
> >>> (Capybara::ElementNotFound)
> >>> no link with title, id or text 'Edit Account' found
> >>> (Capybara::ElementNotFound)
> >>> I tried scoping it using within but that fails too.
> >>> I know its working fine because the correct pages appear in the
> >>> selenuim controlled browser.
> >>> Can anyone help me out???
> >> My first line of attack for problems like this is to through in a
> >> Then show me the page
> >> before the failing step.
ok, the button thing was a red-herring (it is noted in the capybara
logs about href='#').
the other issue is pretty consistent...but if I took out fakeweb
completely, it works. Setting FakeWeb.allow_net_connect = true
doesn't do it; it only worked for me when I completely removed
FakeWeb. That is too bad as fakeweb is very handy, but it must be
something with how it overloads the Net::HTTP class.
so FYI to those in this thread; try not using fakeweb at all and see
if that helps.
Adam
On Jul 4, 11:14 pm, Adam Greene <adam.gre...@gmail.com> wrote:
> ah, I'm running into the same thing, with :firefox and :chromium
> causing the same not found behavior.
> I'm finding that if I have a few page.should... checks, then it can't
> find the element, but if I just do the find, it works. I've also
> found that calling click('#continue-button') or click_link('#continue-
> button') doesn't work, but calling find('#click-button').click
> does...
> this is all a bit odd and I'm not sure where to start to try and track
> it down... but I'll keep looking! ;)
> On Jul 3, 12:43 am, Matt Wynne <m...@mattwynne.net> wrote:
> > On 2 Jul 2010, at 16:04, al wrote:
> > > I'm having a similar problem.
> > > A show me the page isn't much help unfortunately.
> > > I see this issue on some very basic pages (i.e. no ajax), so the
> > > elements are definitely present - indeed I can see them on the page.
> > > Yet webdriver sometimes fails to locate the elements.
> > > It is the inconsistency that is weird, and makes this difficult to
> > > debug.
> > Must be a timing issue then. Which browser?
> > > On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> > >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote:
> > >>> Hi,
> > >>> I am encountering some inconsistent behaviour withselenium
> > >>> When I run the following tests:
> > >>> ...
> > >>> And I follow "Edit Account"
> > >>> Then I should see "Account Edit Page"
> > >>> When I fill in "Name" with "My New Name"
> > >>> When I press "Save Account"
> > >>> ...
> > >>> I get different pass and fails each time. Mainly when Capybara fails
> > >>> to locate an element on the page. Sometimes it will find and follow
> > >>> the link, sometimes not. It always seems to fail on form elements.
> > >>> A selection of errors that I get:
> > >>> cannot fill in, no text field, text area or password field with id,
> > >>> name, or label 'user_name' found (Capybara::ElementNotFound)
> > >>> no button with value or id or text 'Save Account' found
> > >>> (Capybara::ElementNotFound)
> > >>> no link with title, id or text 'Edit Account' found
> > >>> (Capybara::ElementNotFound)
> > >>> I tried scoping it using within but that fails too.
> > >>> I know its working fine because the correct pages appear in the
> > >>> selenuim controlled browser.
> > >>> Can anyone help me out???
> > >> My first line of attack for problems like this is to through in a
> > >> Then show me the page
> > >> before the failing step.
I think fake_web has an option for allowing local requests, that should fix it for Capybara, I think. You might also try Webmock, it's basically an improved Fakeweb.
On Mon, Jul 5, 2010 at 7:07 PM, Adam Greene <adam.gre...@gmail.com> wrote: > ok, the button thing was a red-herring (it is noted in the capybara > logs about href='#').
> the other issue is pretty consistent...but if I took out fakeweb > completely, it works. Setting FakeWeb.allow_net_connect = true > doesn't do it; it only worked for me when I completely removed > FakeWeb. That is too bad as fakeweb is very handy, but it must be > something with how it overloads the Net::HTTP class.
> so FYI to those in this thread; try not using fakeweb at all and see > if that helps. > Adam
> On Jul 4, 11:14 pm, Adam Greene <adam.gre...@gmail.com> wrote: >> ah, I'm running into the same thing, with :firefox and :chromium >> causing the same not found behavior.
>> I'm finding that if I have a few page.should... checks, then it can't >> find the element, but if I just do the find, it works. I've also >> found that calling click('#continue-button') or click_link('#continue- >> button') doesn't work, but calling find('#click-button').click >> does...
>> this is all a bit odd and I'm not sure where to start to try and track >> it down... but I'll keep looking! ;)
>> On Jul 3, 12:43 am, Matt Wynne <m...@mattwynne.net> wrote:
>> > On 2 Jul 2010, at 16:04, al wrote:
>> > > I'm having a similar problem. >> > > A show me the page isn't much help unfortunately. >> > > I see this issue on some very basic pages (i.e. no ajax), so the >> > > elements are definitely present - indeed I can see them on the page. >> > > Yet webdriver sometimes fails to locate the elements. >> > > It is the inconsistency that is weird, and makes this difficult to >> > > debug.
>> > Must be a timing issue then. Which browser?
>> > > On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote: >> > >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote: >> > >>> Hi,
>> > >>> I am encountering some inconsistent behaviour withselenium
>> > >>> When I run the following tests:
>> > >>> ... >> > >>> And I follow "Edit Account" >> > >>> Then I should see "Account Edit Page" >> > >>> When I fill in "Name" with "My New Name" >> > >>> When I press "Save Account" >> > >>> ...
>> > >>> I get different pass and fails each time. Mainly when Capybara fails >> > >>> to locate an element on the page. Sometimes it will find and follow >> > >>> the link, sometimes not. It always seems to fail on form elements.
>> > >>> A selection of errors that I get:
>> > >>> cannot fill in, no text field, text area or password field with id, >> > >>> name, or label 'user_name' found (Capybara::ElementNotFound)
>> > >>> no button with value or id or text 'Save Account' found >> > >>> (Capybara::ElementNotFound)
>> > >>> no link with title, id or text 'Edit Account' found >> > >>> (Capybara::ElementNotFound)
>> > >>> I tried scoping it using within but that fails too.
>> > >>> I know its working fine because the correct pages appear in the >> > >>> selenuim controlled browser.
>> > >>> Can anyone help me out???
>> > >> My first line of attack for problems like this is to through in a
>> > >> Then show me the page >> > >> before the failing step.
is supposed to do, but it still acts inconsistent when that is set
(even if it is set at the highest level in setup_helper.rb...) The
only way to have it behave consistently was to remove it.
thank you *very* much for the tip about Webmock... trying it out right
now!!
Jonas, one last question: would it be worth starting to collect little
tidbits of 'lessons learned' on a wiki at the capybara site? I
noticed you had a few gems at the bottom of the readme, but this one
might be worth adding, and a few more?
cheers,
Adam
On Jul 5, 1:36 pm, Jonas Nicklas <jonas.nick...@gmail.com> wrote:
> I think fake_web has an option for allowing local requests, that
> should fix it for Capybara, I think. You might also try Webmock, it's
> basically an improved Fakeweb.
> /Jonas
> On Mon, Jul 5, 2010 at 7:07 PM, Adam Greene <adam.gre...@gmail.com> wrote:
> > ok, the button thing was a red-herring (it is noted in the capybara
> > logs about href='#').
> > the other issue is pretty consistent...but if I took out fakeweb
> > completely, it works. Setting FakeWeb.allow_net_connect = true
> > doesn't do it; it only worked for me when I completely removed
> > FakeWeb. That is too bad as fakeweb is very handy, but it must be
> > something with how it overloads the Net::HTTP class.
> > so FYI to those in this thread; try not using fakeweb at all and see
> > if that helps.
> > Adam
> > On Jul 4, 11:14 pm, Adam Greene <adam.gre...@gmail.com> wrote:
> >> ah, I'm running into the same thing, with :firefox and :chromium
> >> causing the same not found behavior.
> >> I'm finding that if I have a few page.should... checks, then it can't
> >> find the element, but if I just do the find, it works. I've also
> >> found that calling click('#continue-button') or click_link('#continue-
> >> button') doesn't work, but calling find('#click-button').click
> >> does...
> >> this is all a bit odd and I'm not sure where to start to try and track
> >> it down... but I'll keep looking! ;)
> >> On Jul 3, 12:43 am, Matt Wynne <m...@mattwynne.net> wrote:
> >> > On 2 Jul 2010, at 16:04, al wrote:
> >> > > I'm having a similar problem.
> >> > > A show me the page isn't much help unfortunately.
> >> > > I see this issue on some very basic pages (i.e. no ajax), so the
> >> > > elements are definitely present - indeed I can see them on the page.
> >> > > Yet webdriver sometimes fails to locate the elements.
> >> > > It is the inconsistency that is weird, and makes this difficult to
> >> > > debug.
> >> > Must be a timing issue then. Which browser?
> >> > > On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> >> > >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote:
> >> > >>> Hi,
> >> > >>> I am encountering some inconsistent behaviour withselenium
> >> > >>> When I run the following tests:
> >> > >>> ...
> >> > >>> And I follow "Edit Account"
> >> > >>> Then I should see "Account Edit Page"
> >> > >>> When I fill in "Name" with "My New Name"
> >> > >>> When I press "Save Account"
> >> > >>> ...
> >> > >>> I get different pass and fails each time. Mainly when Capybara fails
> >> > >>> to locate an element on the page. Sometimes it will find and follow
> >> > >>> the link, sometimes not. It always seems to fail on form elements.
> >> > >>> A selection of errors that I get:
> >> > >>> cannot fill in, no text field, text area or password field with id,
> >> > >>> name, or label 'user_name' found (Capybara::ElementNotFound)
> >> > >>> no button with value or id or text 'Save Account' found
> >> > >>> (Capybara::ElementNotFound)
> >> > >>> no link with title, id or text 'Edit Account' found
> >> > >>> (Capybara::ElementNotFound)
> >> > >>> I tried scoping it using within but that fails too.
> >> > >>> I know its working fine because the correct pages appear in the
> >> > >>> selenuim controlled browser.
> >> > >>> Can anyone help me out???
> >> > >> My first line of attack for problems like this is to through in a
> >> > >> Then show me the page
> >> > >> before the failing step.
I'm generally a bit opposed to wikis, they hardly ever seem to work well. But if there's a consensus on this list that a wiki is a good idea, then I can enable the GitHub wiki for Capy.
On Mon, Jul 5, 2010 at 11:20 PM, Adam Greene <adam.gre...@gmail.com> wrote: > hi Jonas,
> that is what:
> FakeWeb.allow_net_connect = true
> is supposed to do, but it still acts inconsistent when that is set > (even if it is set at the highest level in setup_helper.rb...) The > only way to have it behave consistently was to remove it.
> thank you *very* much for the tip about Webmock... trying it out right > now!!
> Jonas, one last question: would it be worth starting to collect little > tidbits of 'lessons learned' on a wiki at the capybara site? I > noticed you had a few gems at the bottom of the readme, but this one > might be worth adding, and a few more?
> cheers, > Adam
> On Jul 5, 1:36 pm, Jonas Nicklas <jonas.nick...@gmail.com> wrote: >> I think fake_web has an option for allowing local requests, that >> should fix it for Capybara, I think. You might also try Webmock, it's >> basically an improved Fakeweb.
>> /Jonas
>> On Mon, Jul 5, 2010 at 7:07 PM, Adam Greene <adam.gre...@gmail.com> wrote: >> > ok, the button thing was a red-herring (it is noted in the capybara >> > logs about href='#').
>> > the other issue is pretty consistent...but if I took out fakeweb >> > completely, it works. Setting FakeWeb.allow_net_connect = true >> > doesn't do it; it only worked for me when I completely removed >> > FakeWeb. That is too bad as fakeweb is very handy, but it must be >> > something with how it overloads the Net::HTTP class.
>> > so FYI to those in this thread; try not using fakeweb at all and see >> > if that helps. >> > Adam
>> > On Jul 4, 11:14 pm, Adam Greene <adam.gre...@gmail.com> wrote: >> >> ah, I'm running into the same thing, with :firefox and :chromium >> >> causing the same not found behavior.
>> >> I'm finding that if I have a few page.should... checks, then it can't >> >> find the element, but if I just do the find, it works. I've also >> >> found that calling click('#continue-button') or click_link('#continue- >> >> button') doesn't work, but calling find('#click-button').click >> >> does...
>> >> this is all a bit odd and I'm not sure where to start to try and track >> >> it down... but I'll keep looking! ;)
>> >> On Jul 3, 12:43 am, Matt Wynne <m...@mattwynne.net> wrote:
>> >> > On 2 Jul 2010, at 16:04, al wrote:
>> >> > > I'm having a similar problem. >> >> > > A show me the page isn't much help unfortunately. >> >> > > I see this issue on some very basic pages (i.e. no ajax), so the >> >> > > elements are definitely present - indeed I can see them on the page. >> >> > > Yet webdriver sometimes fails to locate the elements. >> >> > > It is the inconsistency that is weird, and makes this difficult to >> >> > > debug.
>> >> > Must be a timing issue then. Which browser?
>> >> > > On Jun 10, 6:48 pm, Rick DeNatale <rick.denat...@gmail.com> wrote: >> >> > >> On Wed, Jun 9, 2010 at 9:27 AM, Ben <benald...@gmail.com> wrote: >> >> > >>> Hi,
>> >> > >>> I am encountering some inconsistent behaviour withselenium
>> >> > >>> When I run the following tests:
>> >> > >>> ... >> >> > >>> And I follow "Edit Account" >> >> > >>> Then I should see "Account Edit Page" >> >> > >>> When I fill in "Name" with "My New Name" >> >> > >>> When I press "Save Account" >> >> > >>> ...
>> >> > >>> I get different pass and fails each time. Mainly when Capybara fails >> >> > >>> to locate an element on the page. Sometimes it will find and follow >> >> > >>> the link, sometimes not. It always seems to fail on form elements.
>> >> > >>> A selection of errors that I get:
>> >> > >>> cannot fill in, no text field, text area or password field with id, >> >> > >>> name, or label 'user_name' found (Capybara::ElementNotFound)
>> >> > >>> no button with value or id or text 'Save Account' found >> >> > >>> (Capybara::ElementNotFound)
>> >> > >>> no link with title, id or text 'Edit Account' found >> >> > >>> (Capybara::ElementNotFound)
>> >> > >>> I tried scoping it using within but that fails too.
>> >> > >>> I know its working fine because the correct pages appear in the >> >> > >>> selenuim controlled browser.
>> >> > >>> Can anyone help me out???
>> >> > >> My first line of attack for problems like this is to through in a
>> >> > >> Then show me the page >> >> > >> before the failing step.
just as an FYI, Webmock definitely worked better for me, but I'm still
getting some inconsistant timing errors... links not being found,
EOFError errors, etc. Oh well, no http mocking at all for now. So
odd! I'll dig in a bit more to see if I can see what is going on, but
it definitely feels like a webdriver error rather than something in
capybara.
hmmm, enabling the new curb settings for firefox makes it work, even
with fakeweb or Webmock... but it is *slow*... about 3x slower for my
small set of interactive tests. hmmmm...
you need to do something like this wherever you setup capybara:
> just as an FYI, Webmock definitely worked better for me, but I'm still
> getting some inconsistant timing errors... links not being found,
> EOFError errors, etc. Oh well, no http mocking at all for now. So
> odd! I'll dig in a bit more to see if I can see what is going on, but
> it definitely feels like a webdriver error rather than something in
> capybara.
> I am encountering some inconsistent behaviour with selenium
> When I run the following tests:
> ...
> And I follow "Edit Account"
> Then I should see "Account Edit Page"
> When I fill in "Name" with "My New Name"
> When I press "Save Account"
> ...
> I get different pass and fails each time. Mainly when Capybara fails
> to locate an element on the page. Sometimes it will find and follow
> the link, sometimes not. It always seems to fail on form elements.
> A selection of errors that I get:
> cannot fill in, no text field, text area or password field with id,
> name, or label 'user_name' found (Capybara::ElementNotFound)
> no button with value or id or text 'Save Account' found
> (Capybara::ElementNotFound)
> no link with title, id or text 'Edit Account' found
> (Capybara::ElementNotFound)
> I tried scoping it using within but that fails too.
> I know its working fine because the correct pages appear in the
> selenuim controlled browser.
> Can anyone help me out???
> I am testing a Rails 2.3.5 with capybara (0.3.8), using with cucumber
> cucumber (0.8.0)