我不太确定我的代码是什么问题,显然我在某个地方出了问题。这是代码;
Then(/^the room selection should be switched to auto assign$/) do
autoassign = @browser.iframe(:id , 'iconsole-plugin-session_iframe__').div(:class , 'col-md-8 column').span(:id , 'selected_room').html
Watir::Wait.for_condition(10 , 2 , "Waiting for room to auto assign") {
autoassign.attribute_value(:id).eql?('Auto Assignment')
}
end
这是错误;
undefined method `attribute_value' for "<span id=\"selected_room\">Auto Assignment</span>":String (NoMethodError)
答案 0 :(得分:0)
autoassign
的类型为String
。 Ruby String
class没有名为attribute_value
的方法。
尝试从第一行删除.html
,使其看起来像这样:
autoassign = @browser.iframe(:id , 'iconsole-plugin-session_iframe__').div(:class , 'col-md-8 column').span(:id , 'selected_room')
Watir::Wait.for_condition(10 , 2 , "Waiting for room to auto assign") {
autoassign.attribute_value(:id).eql?('Auto Assignment')
}