watirスクリプトに、ajaxが挿入されたログインボックスが開くのを待つように指示しようとしています。watir-webdriverを使用しており、Chromeでテストしています。wait_until
以下の(簡略化された)スクリプトでコメントされているように、私は仕事に取り掛かることができません。
require "rubygems"
require "watir-webdriver"
b = Watir::Browser.new(:chrome)
site = "www.example.com"
b.goto site
puts "Click on Sign In button"
b.link(:id, 'btnLogin').click
puts "Waiting for the username/password dialog to show up"
# Below line does *not* work
# Throws this error: "uninitialized constant Watir::Waiter (NameError)"
Watir::Waiter::wait_until { b.text_field(:id, 'username').exists? }
# Below line does *not* work
# Throws this error: "undefined method `wait_until' for main:Object (NoMethodError)"
wait_until { b.text_field(:id, 'username').exists? }
# Below line *does* work, but I don't want to use it.
sleep 1 until b.text_field(:id, 'username').exists?
Watir::Waiter
IEのみのクラスですか?または、私が間違っているのは、sleep 1
waitメソッドが正常に機能することです。私はRubyとwatirに不慣れです、私は文字通り昨日これを拾いました、それで私はこれが私の無愛想さの結果であると半分期待しています。
関連する場合は、私はMac(OSX v。10.6.5)で作業しています。