Restart Browser After Every Feature File

本小妞迷上赌 提交于 2019-12-08 05:27:17

问题


I would like my Protractor- CucumberJS framework to start browser at the start of every feature file - load the URL - execute scenarios - close the browser once all scenarios are done executing - launch fresh browser instance for next feature file...and so on.

I am using Beforefeature hook to launch URL and Afterfeature hook to do browser.quit()

Tried setting shardTestFiles to true in multiCapabilities. It does launch a separate browser for every feature file but throws error - NoSuchSessionError: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.

Setting restartBrowserBetweenTests to true in config file closes and opens browser instance for every scenario - not what I want.

How can this be accomplished?

来源:https://stackoverflow.com/questions/39904082/restart-browser-after-every-feature-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!