Tag: 自动化测试

Selenium慢点击动作只有localhost

我在本地运行selenium,但在查找和点击时速度非常慢。 test_helper.rb中 Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome) end 这是我页面上的测试: feature “dashboard” do include Warden::Test::Helpers scenario “test1”, :js => true do visit root_path visit new_user_session_path #any of this are super slow #find(“a[href=’#{/users/sign_up}’]”).click #page.find(:css, ‘a[href=”/users/passsword/new”]’).click #page.find(:xpath, “//a[@href=’/users/sign_up’]”).click end 但是,访问行动几乎是即时的。 我尝试过另一个测试: feature “dashboard” do include Warden::Test::Helpers scenario “test1”, :js => true do visit ‘http://www.google.com.uy’ page.find(:xpath, “//a[@href=’//www.google.com.uy/intl/es-419/about.html?fg=1′]”).click […]

当存在具有相同显示文本的其他链接时,使用Watir单击特定链接

所以我有一张桌子看起来就像那里有书籍清单,在第一栏中有两个链接,查看和删除,每本书。 我希望能够使用Watir找到具有指定书名的行,然后单击该书的该视图按钮。 这是我到目前为止所拥有的 And /^click on View link of “(.*)” on the result set table$/ do |cell_name| cellButton(“submit.view”, cell_name, “”) end # # And /^click on Delete link of “(.*)” on the result set table with no_wait$/ do |cell_name| cellButton(“submit.delete”, cell_name, “no_wait”) end # # def cellButton(submit_type, s_name, s_wait_type) c_found = 0 @browser.tables do |tbl| […]

Web应用程序的集成测试

我想对Web应用程序进行完全集成测试。 我想测试很多东西,比如AJAX, 使用多个浏览器定位和存在某些短语和HTML元素。 我正在寻找一种工具来进行这种自动化测试。 另一方面; 这是我第一次使用集成测试。 进行此类测试时是否有任何具体建议? 还有任何教程吗? (注意:我的后端代码是使用Perl,Python和Django完成的。) 谢谢!

Selenium RC:自动在多个浏览器中运行测试

所以,我已经开始创建一些使用Selenium RC直接在浏览器中测试我的Web应用程序的Rubyunit testing。 我正在使用Selenum-Client作为ruby。 我已经为我inheritance的所有其他selenium测试创建了一个基类。 这会创建大量SeleniumDriver实例,并在每个实例上调用所有缺少的方法。 这基本上是并行运行测试。 其他人如何自动化这个? 这是我的实现: class SeleniumTest < Test::Unit::TestCase def setup @seleniums = %w(*firefox *iexplore).map do |browser| puts 'creating browser ' + browser Selenium::SeleniumDriver.new("localhost", 4444, browser, "http://localhost:3003", 10000) end start open start_address end def teardown stop end #sub-classes should override this if they want to change it def start_address "http://localhost:3003/" end […]