Selenium-Webdriver Ruby --> How to wait for images to be fully loaded after click

后端 未结 4 1665
星月不相逢
星月不相逢 2020-12-11 23:33

I am very new to Ruby and Selenium-Webdriver, so please, help :)

I am trying to open email campaign , sent to my inbox, that has images and take a screenshot in the

4条回答
  •  北海茫月
    2020-12-12 00:07

    Ruby code from the docs (click on the 'ruby' button):

    wait = Selenium::WebDriver::Wait.new(:timeout => 10) # seconds
    begin
      element = wait.until { driver.find_element(:id => "some-dynamic-element") }
    ensure
      driver.quit
    end
    

    Which works for me

提交回复
热议问题