Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 含硒水豚等待onchange事件_Google Chrome_Selenium_Capybara - Fatal编程技术网

Google chrome 含硒水豚等待onchange事件

Google chrome 含硒水豚等待onchange事件,google-chrome,selenium,capybara,Google Chrome,Selenium,Capybara,我有一个带有onchange事件的表单字段,它将一些文本插入到页面中 fill_in "password", :with => 'test' # should trigger onchange which inserts the text below into the page page.should have_content('very insecure') 现在,当我用cucumber/capybara/selenium和firefox进行测试时,它可以正常工作。使用硒和铬,水豚抱怨

我有一个带有onchange事件的表单字段,它将一些文本插入到页面中

fill_in "password", :with => 'test' # should trigger onchange which inserts the text below into the page
page.should have_content('very insecure')
现在,当我用cucumber/capybara/selenium和firefox进行测试时,它可以正常工作。使用硒和铬,水豚抱怨文档中找不到文本


现在我想知道如何解决这个问题。我是否需要手动调用该事件(在我看来,这将是真正的黑客行为)?或者我只是需要等待所有事件在我的填写和应该有内容方法之间被处理(如何处理?)

如果您觉得这是一个需要等待更长时间的问题,我会在页面之前加入“睡眠3”。应该。还有一些原始的Selenium命令用于此操作,但最好避免使用。

has\u content方法应该已经在等待文本出现,所以我认为这不是问题所在。似乎更可能是webdriver/chrome的问题。