Selenium慢点击动作仅本地主机 [英] Selenium slow click action only localhost

查看:50
本文介绍了Selenium慢点击动作仅本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地运行硒,但是查找和单击的速度非常慢.

I am running selenium locally, but it is extremely slow on find and click.

test_helper.rb

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 

但是,访问动作几乎是立即进行的.

However, the visit action is almost instantly.

我尝试了另一项测试:

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
   end 

它奏效了.

如何在我的网站上找到原因? new_user_session_path是设备的默认模板和控制器.

How can I find the cause on my site? The new_user_session_path is devise's default template and controller.

推荐答案

必须禁用Turbolink. Capybara可以工作,但是通过byebug执行命令时速度很慢

Had to disable Turbolinks. Capybara worked but was slow when executing commands through byebug

这篇关于Selenium慢点击动作仅本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆