Selenium slow click action only localhost

喜欢而已 提交于 2020-01-05 06:43:28

问题


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

test_helper.rb

Capybara.register_driver :selenium do |app|
    Capybara::Selenium::Driver.new(app, browser: :chrome)
end

This is a test on my page:

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.

I've tried another test:

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 

And it worked.

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


回答1:


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



来源:https://stackoverflow.com/questions/41764935/selenium-slow-click-action-only-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!