Watir message: Instead of passing arguments into #wait_until_present method, use keywords
Asked Answered
R

2

5

I use watir with firefox to grab a webpage after filling a form. Here a short part of my code:

browser.button(:type => 'submit').click
sleep 10
browser.element(:id => 'footer').wait_until_present(timeout=30)
html = browser.html

This message occur:

Instead of passing arguments into #wait_until_present method, use Keywords

What does that mean? How can i solve this? Thanks for help.

Rosalie answered 20/11, 2016 at 8:35 Comment(0)
F
11

The answer is on the new Watir 6.0 FAQ: http://watir.github.io/watir-6-faq/#G

In your case, change from timeout=30 to timeout: 30 and you won't see the warning message.

Foible answered 20/11, 2016 at 15:20 Comment(0)
S
0

The API of watir says #wait_until_present(timeout = nil) ⇒ Object

The timeout = nil part is an optional parameter, if you want a timeout you just need to pass a number to the method.

browser.element(:id => 'footer').wait_until_present(30)
Saddletree answered 20/11, 2016 at 13:22 Comment(1)
The API changed with Watir 6.0 which was released 2 weeks ago.Foible

© 2022 - 2024 — McMap. All rights reserved.