简体   繁体   English

如何在Ruby中使用Selenium Web驱动程序加载自定义Chrome扩展程序?

[英]How to load custom chrome extension using selenium web driver in ruby?

执行selenium Web驱动程序时,有什么方法可以加载自定义chrome扩展(实际上是js文件的文件夹)?

require 'selenium-webdriver'

driver = Selenium::WebDriver.for :chrome, 
  :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome({
    'chromeOptions' => {
      'extensions' => [
        Base64.strict_encode64(File.open('/Users/user/Downloads/hallway_extension.crx', 'rb').read)
      ]
    }
  })

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们可以使用Ruby集成Sikuli和Selenium Web驱动程序吗 - Can we integrate Sikuli and Selenium Web driver using Ruby Selenium Web驱动程序使用Ruby从标签的for属性获取文本 - Selenium web driver getting the text from the for attribute of a label using Ruby 如何单击文本区域以使用Selenium Web驱动程序使用ruby发送长文本 - how to click on text area to send long text using ruby with selenium web driver 如何在Ruby的Selenium Web驱动程序中获得测试用例名称? - how to get the test case name in selenium web driver in ruby? 如何配置Selenium Web驱动程序以在后台启动chrome浏览器 - How to configure Selenium web driver to start a chrome browser in the background 在ruby中设置selenium chrome驱动程序的代理 - Set proxy for selenium chrome driver in ruby 尝试使用Selenium和Ruby加载默认的Chrome配置文件以进行测试 - Trying to load default chrome profile using Selenium and Ruby for testing 如何使用Ruby调用定义的Capybara驱动程序的Selenium方法? - How to call Selenium methods with defined Capybara driver using Ruby? 如何使用Capybara和Selenium Web驱动程序发送密钥 - How do I send keys using Capybara with selenium web driver undefined方法select_list使用ruby与watir 2.0和Selenium Web驱动程序一起使用 - undefined method select_list using ruby with watir 2.0 & selenium web driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM