ruby - I want to get my input with selenium webdriver -


i need input onetime password coded below make alert.

$driver = selenium::webdriver.for :firefox $driver.execute_script("window.promptresponse=prompt('enter onetime password')") alert = $driver.switch_to.alert sleep 5 alert.accept input = $driver.execute_script("return window.promptresponse").to_s p input 

in way, can input when enter password , leave away 5 seconds. (i mean never click ok button)

but can't when click ok before 5 seconds pass. have idea?

you can't it, because script fails before getting input value. when accept alert manually, step alert.accept can't execute because there no alert accept. shouldn't accept alert manually during automatic execution.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -