Selenium WebDriver : How do I set capabilities elementScrollBehavior to 1 for a FireFox configuration in rails?

后端 未结 1 842
遇见更好的自我
遇见更好的自我 2021-01-24 22:23

I have a rails app that uses selenium-webdriver (2.53.0). I am trying to overcome to the issue with Selenium (with a Firefox driver) where buttons that scroll under a static hea

1条回答
  •  暖寄归人
    2021-01-24 22:55

    My environment isn't set up the same as yours but capabilities object needs to be set.

    require 'selenium-webdriver'
    
    Capybara.register_driver :selenium do |app|
    
      http_client = Selenium::WebDriver::Remote::Http::Default.new
      http_client.timeout = 120
    
      capabilities = Selenium::WebDriver::Remote::Capabilities.firefox( :elementScrollBehavior => 1 )
    
      Capybara::Selenium::Driver.new(
        app,
        :browser => :firefox,
        :desired_capabilities  => capabilities,
        :http_client => http_client
      )
    end
    

    0 讨论(0)
提交回复
热议问题