How do I use Watir::Waiter::wait_until to force Chrome to wait?

前端 未结 3 1406
南笙
南笙 2020-12-14 03:01

I\'m trying to tell my watir script to wait for an ajax-injected login box to open up. I am using watir-webdriver, and testing in Chrome. I cannot get wait_until

3条回答
  •  自闭症患者
    2020-12-14 03:40

    Do this first:

    require "watir-webdriver/wait"
    

    Then try these:

    1

    Watir::Wait.until { ... }
    

    2

    browser.text_field(:id => 'username').when_present.set("name")
    

    3

    browser.text_field(:id => 'username').wait_until_present
    

    Note that "present" here means "the element both exists and is visible".

提交回复
热议问题