selenium webdriver - Chromedriver does not load web page in headless mode - Stack Overflow

Our team is experiencing an issue with Selenium in Ruby that web page does not load when using Chrome b

Our team is experiencing an issue with Selenium in Ruby that web page does not load when using Chrome browser in headless mode, page loads properly when running test with head. Also, we noticed that when we take a screenshot of page while in headless mode, it loads a little bit. We implemented a very silly hack to load page in headless mode, but it would be good to hear from community if this issue known and/or how people solve it. Thank you!

OS: Mac OS Sequoia
Tool: Selenium (Capybara) with Ruby 3.2.0
Chromedriver: "ChromeDriver 134.0.6998.90 (219ee74681fc640b1ee1af1c99df3729a0ec25a8-refs/branch-heads/6998@{#1900})"

Our "hack" to load page in headless mode:

  def chrome_headless_screenshot_hack
    if browser.include?('chrome_headless')
      10.times do
        page.save_screenshot("chrome_headless_hack.png")
        sleep 1
      end
    end
  end

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744181829a4562018.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信