I'm trying to configure capybara + rspec +selenoid, to run tests in headless mode. This is my configuration
Capybara.default_max_wait_time = 5
Capybara.javascript_driver = :selenium_chrome_headless
Capybara.current_driver = :selenium_chrome_headless
caps = Selenium::WebDriver::Remote::Capabilities.new
caps['browserName'] = 'chrome'
caps['browserVersion'] = '88.0'
caps['"enableVNC"'] = 'True'
Selenium::WebDriver.for(
:remote,
url: 'http://localhost:4444/wd/hub',
desired_capabilities: caps
)
I run My test - rspec spec/spec_test.rb
:
require_relative '../spec_helper.rb'
link1 = 'https://github.com'
link2 = 'https://yandex.ru'
link3 = 'https://www.google.com'
feature 'Main test' do
scenario 'Test for check selenoid' do
[link1, link2, link3].each { |l| visit l; sleep 5 }
end
end
But when i start http://localhost:8080б I can't see what's going on in the browser. If i start http://localhost:8080/status
{"state":{"total":5,"used":1,"queued":0,"pending":0,"browsers":{"chrome":{"87.0":{},"88.0":{"unknown":{"count":1,"sessions":[{"id":"109e35b770004249fa66059b8135edac","container":"c11ff9c042dcd4e30725fb11c7613cfc7ec26c014035d7b74a0b974bf4b45006","caps":{"browserName":"chrome","version":"88.0","screenResolution":"1920x1080x24","enableVNC":false,"name":"","timeZone":""}}]}}},"firefox":{"84.0":{},"85.0":{}},"opera":{"72.0":{},"73.0":{}}},"videos":null},"origin":"http://selenoid:4444","browsers":{"chrome":1,"firefox":0,"opera":0},"sessions":{"109e35b770004249fa66059b8135edac":{"id":"109e35b770004249fa66059b8135edac","container":"c11ff9c042dcd4e30725fb11c7613cfc7ec26c014035d7b74a0b974bf4b45006","caps":{"browserName":"chrome","version":"88.0","screenResolution":"1920x1080x24","enableVNC":false,"name":"","timeZone":""},"quota":"unknown"}},"version":"1.10.2[2020-11-18_07:31:01AM]","errors":[]}
I detected "enableVNC":false in preferences, probably it's very important ? Maybe I didn't take into some setting ?
But, if I run only test ruby spec/spec_test.rb
, without setting, I don't see started browser in selenoid
caps = Selenium::WebDriver::Remote::Capabilities.new
caps['browserName'] = 'chrome'
caps['version'] = '88'
caps['"enableVNC"'] = 'True'
Selenium::WebDriver.logger.level = :info
driver = Selenium::WebDriver.for(
:remote,
url: 'http://127.0.0.1:4444/wd/hub',
desired_capabilities: caps
)
driver.get 'https://www.google.com'
sleep 5
driver.quit
Should be the following:
caps['enableVNC'] = true