我正在使用带有 Watir-webdriver 的页面对象 gem。在这里,我正在使用“populate_page_with”功能,当有一些等待元素加载时我无法使用它。
在下面的脚本中,我应该输入详细信息:sum_ctgy
,:sd
然后:foregin
我应该等待:sumc
可见。我在 yml 文件中使用 populate_page_with data_for 方法,数据如下
sumdetailspage:
sum_ctgy: Test1
sd: Test2
sumc: 502
sumd: -450
请告诉我使用填充方法解决此问题的更好方法。
class SumDetailsPage
include PageObject
include DataMagic
select_list(:sum_ctgy, :name => /categoryDescription/) --> send details
text_field(:sd, :id => /sumDestination/) --> continue
text_field(:foreign, :name => /foreignSymbol/) --> continue
div(:pw, :id => /PleaseWaitMessage/) --> please wait behavior to complete(until hidden)
text_field(:sumc, :id => /sumCalc/) --> then continue, but it is not waiting for this element to load
text_field(:sumd, :id => /sumCalcdep/)
def train_details(data = {})
DataMagic.load('traindata.yml')
populate_page_with data_for(:sumdetailspage, data)
pw_element.when_not_visible --> wait
populate_page_with data_for(:sumdetailspage, data) --> again continue...
end
end