Ruby on rails 如何在Selenium的RubyonRails实现中使用警报和提示JS对话框?
我现在正在学习硒。我将在RubyonRails项目中使用它。现在我创建了演示项目,只是为了在Rails上测试Selenium #{RAILS_ROOT}/test/selenium/articles/delete_article.rsel的内容如下:Ruby on rails 如何在Selenium的RubyonRails实现中使用警报和提示JS对话框?,ruby-on-rails,ruby,selenium,Ruby On Rails,Ruby,Selenium,我现在正在学习硒。我将在RubyonRails项目中使用它。现在我创建了演示项目,只是为了在Rails上测试Selenium #{RAILS_ROOT}/test/selenium/articles/delete_article.rsel的内容如下: setup :fixtures => :all open "/articles" assert_text_present("First Article title") assert_text_present("Destroy") cli
setup :fixtures => :all
open "/articles"
assert_text_present("First Article title")
assert_text_present("Destroy")
click_and_wait("Destroy")
assert_match /Are you sure/i, get_confirmation
assert_text_present("Articles")
assert_text_not_present("First Article title")
在此测试运行期间,我遇到以下错误:
undefined local variable or method `get_confirmation' for #<SeleniumOnRails::RSelenese::Evaluator
未定义的局部变量或#的“get_confirmation”方法尝试以下操作:
assert_alert /Are you sure/i
或者这个:
assert_confirmation /Are you sure/i
更多