I am working on building a test automation project for our application using SpecFlow, SpecFlow+ and Selenium WebDriver. Have been going through a few tutorials and each has a different viewpoint.
- SpecFlow.org says to use an MSTest (.NET Code) or Unit Test (.NET Framework) once the solution is created
- Other tutorials on Selenium sat to use the Class Library (.NET Framework) or the Unit Test (.NET Framework) https://saucelabs.com/resources/articles/getting-started-with-webdriver-in-c-using-visual-studio
- Still others say to use Console App (.NET Framework) https://www.guru99.com/selenium-csharp-tutorial.html
So can anyone inform what is the best project-type to use with the SpecFlow project and what to use with the Selenium project in the same VS 2019 Solution?
Also, should I have the main project as the SpecFlow and the added project as Selenium (or vice-versa)?
Has anyone done a similar solution with 2 projects that I can have a look at?
I use .NET Core class libraries.
static void mainmethod as the entry point and gives you nice text output where you want it. That's probably why you see it in tutorials as it's easier - but this would eventually just be more effort as you don't run test like program. You'll use a test runner to kick tests off.Have a look here for an example on github. It's selenium nunit and specflow (not specflow+ or multi project) but it's close enough to give you an idea if you need it. If I had to convert this i'd move the relevant folders to their own project...
In regards to one project vs multiple projects in a solution I would say it's not critical to the design. If you're a beginner, stick with one for now as that reduces the overall complexity. It's not complex to do references but it might slow you down early on.
If you do go with multiple projects - it really doesn't matter what does in first. Probably start from the bottom and do the selenium core stuff first. Nothing will run without selenium so everything will depend on that. You're more likely to swap out the test/data layer later on.