我想不出一种与突出显示的 HTML 交互的方法:
当我点击一个链接时,会出现一个交互式模式,其中有一个允许用户购买零件的表格。此外,模态具有在模态中打开新部分的链接。
我试图编写步骤定义,但无法通过测试。请参阅下面的我的(最新尝试)代码:
When /^I click on the Buy icon of loan part selected$/ do
@browser.div(:id, 'modal_loan_parts_table').link(:text, 'Buy').click
end
我不断收到的错误是element not located
. 有人可以指导我启蒙吗?
这是发生的错误:
unable to locate element, using {:id=>"modal_loan_parts_table", :tag_name=>"div"} (Watir::Exception::UnknownObjectException)
./step_definitions/secondarymkt_buying_lp.rb:62:in `/^I click on the Buy icon of loan part selected$/'
secondarymkt_buying_lp.feature:27:in `When I cllick on the Buy icon of loan part selected'
非常感谢伙计们!