现在我有这样的watir代码:
require "watir-webdriver"
browser = Watir::Browser.new :ff
browser.driver.manage.timeouts.implicit_wait = 3 #3 seconds
browser.goto "https://page***/default.aspx"
browser.select_list(:name => 'ctl00$tresc$cbListaKrajow').select_value('6')
puts "Selected country"
browser.select_list(:name => 'ctl00$tresc$cbListaPlacowek').wait_until_present
browser.select_list(:name => 'ctl00$tresc$cbListaPlacowek').select_value('95')
puts "Selected city"
但主要问题是ctl00$tresc$cbListaPlacowek
仅通过加载它的选项
ctl00$tresc$cbListaKrajow is changed. It could take 1 or 30 seconds so `browser.driver.manage.timeouts.implicit_wait = 3 #3 seconds` is not a good idea. How can i write that it try to select option unless it is present? Now i get errors like it could find such option...