一次运行所有 selenium ruby webdriver 脚本. [英] run all selenium ruby webdriver scripts at a time.
问题描述
目前,我正在 Ruby 命令提示符窗口上运行我的每个 Selenium Ruby Webdriver 脚本 (*.rb),其语法例如:ruby test.rb.效果很好.
Currently, I'm running each my Selenium Ruby Webdriver script (*.rb) on Ruby command prompt window with the syntax, ex: ruby test.rb. It works well.
但是,我还有一些其他的脚本,现在我想运行所有脚本一次而不是调用 ruby test1.rb,然后等待这个脚本完成,然后继续运行:ruby test2.rb.....then, ruby test3.rb ....
However, I also have some other scripts and now I want to run all scripts once instead of calling ruby test1.rb, then wait for this script done, then continue to run: ruby test2.rb.....then, ruby test3.rb.....
有人请指导我一次运行我创建的所有脚本的方法吗?非常感谢.
Anybody please guide me a way to run all scripts I created at a time? Thanks so much.
推荐答案
你可以使用 rake gem
,为此你需要创建一个名为 rakefile.rb
的文件,并粘贴以下内容:
You can use the rake gem
, for this you need to create a file named rakefile.rb
, and paste the below content:
task :default do
FileList['file*.rb'].each { |file| ruby file }
end
现在在你的终端中调用 rake
,你应该没问题.
Now call rake
in your terminal, you should be good.
这篇关于一次运行所有 selenium ruby webdriver 脚本.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!