Ruby with Watir: Handling javascript popup window

前端 未结 1 1986
慢半拍i
慢半拍i 2021-01-28 14:08

I have a problem with watir and javascript popup window

here\'s my test script

require \'watir\'

browser = Watir::Browser.start \"/url/\"

    browser.l         


        
相关标签:
1条回答
  • 2021-01-28 14:48

    There are two forms of Watir - watir-classic and watir-webdriver. If possible/convenient you should use watir-webdriver because it is the future of browser automation and where all the development focus will be going forward.

    Your code looks fine if you are using watir-webdriver. I have never used watir-classic, but it appears that it only supports initializing a window with a hash instead of multiple arguments. So maybe this will work for you if you need to use watir-classic:

    browser.window(title: /Blog/) { #execute block }

    0 讨论(0)
提交回复
热议问题