def wait_for_element_present(element)
wait = Selenium::WebDriver::Wait.new(:timeout => 30);
wait.until{driver.find_element(element)};
end
Please take a look at the Ruby code above, I have two questions:
(1) As for "Selenium::WebDriver::Wait.new(:timeout => 30)", what does the "=>" mean here? I know ":timeout" is a ruby symbol, but when using it following by a "=>" and a value "30", I get confused. Is this some kind of trick about ruby symbol?
(2) We also have the symbol "=>" when defining hash right? Like:
cars = {
'altima' => 'nissan',
'camry' => 'toyota',
'rx7' => 'mazda'
}
puts cars['rx7'] => mazda
Does the "=>" here has the same meaning as that in question (1)?
I'm a ruby newbie, any comments would be appreciated. Thanks in advance!