-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to define the saucelabs job name for a scenario? #7
Comments
Having the same issue. @rovens did you find a solution? |
Same here. We tried registering a new IWebDriver dependency in a before-scenario hook by providing a custom instance of RemoteWebDriver created at runtime, but that just resulted in the test being run twice — once with the proper name (set at runtime) and once with the static name from App.config. It seems that instead of overriding the IWebDriver dependency it just registers another one (despite using the same type and name), causing Selenium to run the tests twice. Not that it would be a particularly good solution if it worked, but at least it would be a solution. Right now there doesn't appear to be one. |
In the end I was forced to abandon this package.
I wrote a yeoman based scaffolder to create a solution that does all these things. I've added a repo with a sample solution https://github.com/rovens/specflowdemo. If you want the yeoman generator let me know. |
I was able to resolve this by changing the config to use the SauceLabsWebDriver. I then hooked AfterStep, got the Driver from the context as ISauceLabsWebDriver. You can then query the ScenarioContext.Current.ScenarioInfo.Title and ScenarioContext.Current.TestError and call the UpdateSauceLabsResult method on ISauceLabsWebDriver. |
@TheCodeKing Thanks, we were coming up to a similar solution. But doesn't that mean that the name will only change after the test is complete and still have the incorrect name while it's running? |
It will set the name as soon as the first step executes, until then I use the test name "Pending" set in the config. AfterStep seems to be the only hook that gets called on error and is the only place with access to the Driver (unless you create the driver yourself). |
How do you define the job name for a scenario test running at sauce labs? Sauce labs docuementation states you set the 'name' property as a desiredcapability for the webdriver. Although you can set this is the app.config, it means you cannot set the name per scenario. Are you able to give me a suggestion as to where this might go? Love the project be the way :-)
Robert.
The text was updated successfully, but these errors were encountered: