I am executing the Specflow BDD test and due to some issue on Chrome I need to do some tests on Firefox and rest of the tests on Chrome
Setup I did:
Add @Firefox Tag to the scenario which needs to be executed on Firefox
[BeforeScenario]
string[] tags=scenarioContext.ScenarioInfo.Tags
if (tags.Contains("Firefox")) {
ExecutionSettings.BrowserType="Firefox";
} else {
ExecutionSettings.BrowserType=Chrome;
}
**AdditionalSettup: **ExecutionSettings is class which is getting the value from appsettings. BrowserType is a static property in this class.
And at [BeforeTest] I am loading all my appsettings properties and deserializing them to Settings class( here BrowserType is also set to Chrome)
SO
- BeforeTest code is setting BrowserType to ‘Chrome’.
- In Before Scenario I want to again set the value as mentioned again.
Problem: When Running test in parallel, the tests not having the Firefox tags are also executed on firefox. which I don’t want.
How can I sort this out?