Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Inconsistencies finding elements on the page with Selenium
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben  
View profile  
 More options Jun 9 2010, 9:27 am
From: Ben <benald...@gmail.com>
Date: Wed, 9 Jun 2010 06:27:53 -0700 (PDT)
Local: Wed, Jun 9 2010 9:27 am
Subject: Inconsistencies finding elements on the page with Selenium
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???

I am testing a Rails 2.3.5 with capybara (0.3.8), using with cucumber
cucumber (0.8.0)

in my env.rb i have set

Capybara.default_selector = :css
Capybara.javascript_driver = :selenium

Any help would be greatly appreciated!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick DeNatale  
View profile  
 More options Jun 10 2010, 1:48 pm
From: Rick DeNatale <rick.denat...@gmail.com>
Date: Thu, 10 Jun 2010 13:48:58 -0400
Local: Thurs, Jun 10 2010 1:48 pm
Subject: Re: [Capybara] Inconsistencies finding elements on the page with Selenium

My first line of attack for problems like this is to through in a

Then show me the page
before the failing step.

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
al  
View profile  
 More options Jul 2 2010, 11:04 am
From: al <alistairhutchi...@googlemail.com>
Date: Fri, 2 Jul 2010 08:04:40 -0700 (PDT)
Local: Fri, Jul 2 2010 11:04 am
Subject: Re: Inconsistencies finding elements on the page with Selenium
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Wynne  
View profile  
 More options Jul 3 2010, 3:43 am
From: Matt Wynne <m...@mattwynne.net>
Date: Sat, 3 Jul 2010 08:43:05 +0100
Local: Sat, Jul 3 2010 3:43 am
Subject: Re: [Capybara] Re: Inconsistencies finding elements on the page with Selenium

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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Greene  
View profile  
 More options Jul 5 2010, 2:14 am
From: Adam Greene <adam.gre...@gmail.com>
Date: Sun, 4 Jul 2010 23:14:25 -0700 (PDT)
Local: Mon, Jul 5 2010 2:14 am
Subject: Re: Inconsistencies finding elements on the page with Selenium
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Greene  
View profile  
 More options Jul 5 2010, 1:07 pm
From: Adam Greene <adam.gre...@gmail.com>
Date: Mon, 5 Jul 2010 10:07:33 -0700 (PDT)
Local: Mon, Jul 5 2010 1:07 pm
Subject: Re: Inconsistencies finding elements on the page with Selenium
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonas Nicklas  
View profile  
 More options Jul 5 2010, 4:36 pm
From: Jonas Nicklas <jonas.nick...@gmail.com>
Date: Mon, 5 Jul 2010 22:36:49 +0200
Local: Mon, Jul 5 2010 4:36 pm
Subject: Re: [Capybara] Re: Inconsistencies finding elements on the page with Selenium
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Greene  
View profile  
 More options Jul 5 2010, 5:20 pm
From: Adam Greene <adam.gre...@gmail.com>
Date: Mon, 5 Jul 2010 14:20:21 -0700 (PDT)
Local: Mon, Jul 5 2010 5:20 pm
Subject: Re: Inconsistencies finding elements on the page with Selenium
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonas Nicklas  
View profile  
 More options Jul 5 2010, 5:28 pm
From: Jonas Nicklas <jonas.nick...@gmail.com>
Date: Mon, 5 Jul 2010 23:28:57 +0200
Local: Mon, Jul 5 2010 5:28 pm
Subject: Re: [Capybara] Re: Inconsistencies finding elements on the page with Selenium
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.

/Jonas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Greene  
View profile  
 More options Jul 5 2010, 5:57 pm
From: Adam Greene <adam.gre...@gmail.com>
Date: Mon, 5 Jul 2010 14:57:24 -0700 (PDT)
Local: Mon, Jul 5 2010 5:57 pm
Subject: Re: Inconsistencies finding elements on the page with Selenium
understand ;)

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.

Adam


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Greene  
View profile  
 More options Jul 5 2010, 6:19 pm
From: Adam Greene <adam.gre...@gmail.com>
Date: Mon, 5 Jul 2010 15:19:08 -0700 (PDT)
Local: Mon, Jul 5 2010 6:19 pm
Subject: Re: Inconsistencies finding elements on the page with Selenium
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:

      Selenium::WebDriver.for :firefox, :http_client =>
Selenium::WebDriver::Remote::Http::Curb

On Jul 5, 2:57 pm, Adam Greene <adam.gre...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Houdini  
View profile  
 More options Jul 18 2010, 10:25 pm
From: Houdini <dmitrii.go...@gmail.com>
Date: Sun, 18 Jul 2010 19:25:16 -0700 (PDT)
Local: Sun, Jul 18 2010 10:25 pm
Subject: Re: Inconsistencies finding elements on the page with Selenium
same thing here
rails 3 beta 4
capybara 0.3.9

On Jun 9, 5:27 pm, Ben <benald...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »