是否有其他人遇到Webdriver延遲問題?我有它與水豚黃瓜運行。填寫表格需要超過30秒甚至幾分鐘的時間。出於某種原因,它將填充一個字段,然後在填寫另一個字段時暫停,兩者都由id引用。Webdriver延遲問題
另外,由於這種延遲,我遇到了超時錯誤。 (但他們是不穩定的......)
有沒有什麼特別的領域。它們出現在頁面加載中,並且此頁面上沒有Ajax。
任何人有任何想法?
這裏的錯誤:
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'
編輯:這可能與這樣的事實,我有一個Firefox的實例時,我跑了黃瓜測試已經打開。雖然超時的頻率減少了,但我仍然經常得到它們,我認爲這仍然是一個問題。
EDIT2:特徵文件將指定一個步: And I complete personal info
步驟將進一步定義爲其他步驟:
And /^I complete personal info$/ do
fill_in('first_id', :with => "foo")
fill_in('second_id', :with => "bar")
...more fill_ins...
end
水豚會發現first_id
有時和我的方案執行的其餘部分精細。其他時候,它會超時。在我看來,這是非常不可預測的。還有些時候,它會發現first_id
,但找不到second_id
。順便說一下,這些頁面上確實存在這些id
。
我應該包含有關錯誤的更多信息。這往往會是這樣的:
...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
與這些額外的步驟定義:
And %{I should see "foo"}
And %{I should see "bar"}
我希望這個額外的信息可以幫助!如果您需要其他東西,請在評論中告訴我。
您的意思是webdriver或selenium-webdriver?此外,什麼版本的webdriver,黃瓜,水豚,鐵軌(看起來像紅寶石企業版1.8.7)? – carols10cents 2011-03-21 13:15:44
我很確定它不是你運行的其他Firefox實例。我不時地使用Cucumber,Capybara和WebDriver堆棧超時 - 但它們從不涉及其他正在運行的FF實例。 – awendt 2011-05-23 15:32:22