1

After update ruby and some gems version on my project, when I press control+c in a cucumber execution console, browser instance is totally closed....... when until now, console proccess was finished but the webdriver instance in the browser remains open and was interactive manually..... Where could be the problem? Some ruby or cucumber environment gem? Webdriver? Some hack to fix without roll back to all previous versions? I´ve already tried to come back to previous ruby version but i still have the problem.

Thanks.

1 Answers1

0

Are you sure your code doesn't call quit or close on the selenium instance? Regardless, it doesn't strike me as particularly surprising that the browser instance would close if it's caller script ended.

I haven't actually done this myself but I've read a bit about methods to keep a selenium-launched browser persistently open.

It basically involves launching a selenium browser from a separate process and then configuring your code to connect to that existing instance. See this SO question on the topic (how-to-use-attach-an-existing-browser-using-selenium).

Another option is to run Selenium server and have your code send a command to start a browser instance. The plus side of this is you have a handy web interface to track all your running selenium instances.

Community
  • 1
  • 1
max pleaner
  • 26,189
  • 9
  • 66
  • 118
  • I have a code that calls window.close() in after scenario global method. But until the gem and ruby update, control+c in console in the middle of a running scenario does not close de web browser window.... its a big problem for me, because cant continue navigation in the web app to check manually some testing injections, service responses and general behaviour on this particular scenario. – user3174355 Apr 19 '16 at 07:55
  • why not open a separate terminal tab for rails console and keep the test running for the duration of time you need the selenium-enabled browser open? – max pleaner Apr 19 '16 at 07:59