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条)