AutomateThePlanet-Learning-Series | Automate The Planet Series Source Code | Machine Learning library
kandi X-RAY | AutomateThePlanet-Learning-Series Summary
kandi X-RAY | AutomateThePlanet-Learning-Series Summary
Welcome to the source code repository of Automate The Planet Learning Series!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AutomateThePlanet-Learning-Series
AutomateThePlanet-Learning-Series Key Features
AutomateThePlanet-Learning-Series Examples and Code Snippets
Community Discussions
Trending Discussions on AutomateThePlanet-Learning-Series
QUESTION
I've seen several approaches to instantiate web driver in Specflow examples.
- Creating it in the steps definition class and disposing it in
Dispose
method for the class
Why is it horrible? Cause 1 scenario doesn't equal 1 steps definition class as some steps are just shared between features and there will be more than 1 web driver instantiated. Example: https://www.softwaretestinghelp.com/specflow-and-selenium/
- Creating it in hooks
[BeforeScenario]
and destroying int in[AfterScenario]
It won't work with parallel execution(according to author). https://github.com/AutomateThePlanet/AutomateThePlanet-Learning-Series/tree/master/Specflow-Series/ExtendTestExecutionWorkflowUsingHooks
Question: How to manage WebDriver
instances in Specflow UI tests solution with NUnit? Where and when initialize it, where and when destroy and how to access it in page object models and steps definition classes?
ANSWER
Answered 2019-Oct-16 at 13:23You need to use the dependency injection framework that comes with SpecFlow. Option #2 where you create it in the [BeforeScenario]
and destroy it in the [AfterScenario]
is the right way to do, but then you need to register the IWebDriver
object with the dependency injection framework:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AutomateThePlanet-Learning-Series
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page