Is anyone else experiencing a latency issue with Webdriver? I have it running on Cucumber with Capybara. And it takes more than 30 seconds or even minutes to fill in a form. For some reason, it will fill in one field and then pause before filling in another field when both are referenced by id.
Also, I'm running into Timeout Errors because of this latency. (But they are erratic...)
There isn't anything special about the fields. T开发者_开发问答hey appear on page load and there is no Ajax on this page.
Anyone have any ideas?
Here's the error:
execution expired (Timeout::Error)
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:2026:in `read_status_line'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:2015:in `read_new'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1051:in `request_without_webmock'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1037:in `request_without_webmock'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:543:in `start'
/Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:1035:in `request_without_webmock'
Edit: This might be related to the fact that I had a Firefox instance already open when I ran the Cucumber tests. Although the frequency of timeouts decreased, I still get them often enough that I think it's still an issue.
Edit2: Feature file will specify a step:
And I complete personal info
The step will be further defined as other steps:
And /^I complete personal info$/ do
fill_in('first_id', :with => "foo")
fill_in('second_id', :with => "bar")
...more fill_ins...
end
Capybara will find first_id
sometimes and the rest of my scenario executes fine. Other times, it will time out. It's very unpredictable, in my opinion. Still other times, it'll find first_id
but not find second_id
. These id
s do indeed exist on the page, by the way.
I should have included more information about the error. It will often look like this:
...all that stuff I included in the error above...
./features/step_definitions/web_steps.rb:107
./features/step_definitions/web_steps.rb:11:in `with_scope'
./features/step_definitions/web_steps.rb:105:in `/^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/'
/my feature file:30:in 'Then we verify stuff we just filled out'
Then we verify stuff we just filled out
is defined with these additional steps:
And %{I should see "foo"}
And %{I should see "bar"}
I hope this extra information helps! If you need anything else, please let me know in the comments.
I'm not familiar with webmock, but looking at the backtrace it's not unlikely that's the culprit - since WebDriver uses HTTP to communicate with Firefox, and specifically Net::HTTP by default.
To confirm this, you can tell WebDriver to use Curb instead, which hopefully won't be affected by what webmock does.
The problem you experienced was caused by WebMock which broke default Net::HTTP beheviour. This issue is now fixed in WebMock 1.7.0
精彩评论