運行使用的Watir的webdriver與Firefox的Rspec的測試時,我收到錯誤 Watir::Exception::UnknownObjectException: unable to locate element, using
{:id=>"submitLogin", :tag_name=>"input"}
from /Users/ktobo/.rbenv/versions/2.2.
我剛剛遇到了這個問題,並且在處理集合中的元素方面有些困難。在我的情況下,我試圖解析表格並檢查列中單元格中包含的值。 下面是代碼: def check_cells_values(table, cell_index)
table.rows.each do |row|
row.cells[cell_index].text.should == some_value
end
end
在
假設我有一個模態。 @my_modal = @brower.div(id: 'TheModal') 比方說,我有一個測試,帶來了模態(在這個例子中黃瓜) Given I ...
When I ...
Then "My Modal" is visible
When I click outside the modal
Then "My Modal" is visible
我們定義的步驟點擊