1

Recently I switched my cucumber tests from capybara-webkit to chrome. Every time I am running tests locally a new chrome icon appears in the Deck bar. But 5th icon disappears when I start a new test (eg I see maximum four chrome icons)

enter image description here

I use

ChromeDriver 2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052)
chrome Version 70.0.3538.110 (Official Build) (64-bit)

Gem versions:

selenium-webdriver (3.141.0)
capybara (3.11.1)

My capybara driver set up:

# features/support/env.rb

require 'selenium-webdriver'

Capybara.register_driver :chrome do |app|
  options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox])
  options.headless! if tddium?

  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

Capybara.javascript_driver = :chrome

When I am running tests in the headless mode I see that new chrome icons appear, but I don't see browser window

How can I fix that?

Hirurg103
  • 4,783
  • 2
  • 34
  • 50
  • Check this out: https://www.google.co.in/search?ei=dUL1W7O6JIvmvASz-KLICQ&q=prevent+chrome+driver+to+open+a+new+window&oq=prevent+chrome+driver+to+open+a+new+window&gs_l=psy-ab.12..0i71l8.0.0..425115...0.0..0.0.0.......0......gws-wiz.nyRkMpXxMHE – Utkarsh Dubey Nov 21 '18 at 11:40
  • Also this: https://sqa.stackexchange.com/questions/32756/how-to-open-two-separate-tabs-in-same-google-chrome-window-using-webdriver-and-j – Utkarsh Dubey Nov 21 '18 at 11:40
  • If you're actually using headless chrome you shouldn't actually see any icons appear – Thomas Walpole Nov 21 '18 at 20:00
  • @ThomasWalpole I don't use headless mode locally – Hirurg103 Nov 21 '18 at 21:31
  • @Hirurg103 Then edit your question so it doesn't say "Recently I switched my cucumber tests from capybara-webkit to headless chrome" – Thomas Walpole Nov 22 '18 at 00:37
  • @ThomasWalpole the problem is reproducible in the headless mode too. I updated the question – Hirurg103 Nov 23 '18 at 16:27
  • What is reproducible in headless mode? In headless mode there should be no icons shown – Thomas Walpole Nov 23 '18 at 16:33
  • @ThomasWalpole new chrome icons appear (but no new chrome window) when I am running cucumber with chrome driver in the headless mode – Hirurg103 Nov 23 '18 at 16:38
  • This is a duplicate of [another post](https://stackoverflow.com/a/54743593/18850143) – stodja Jan 06 '23 at 09:58

0 Answers0