You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unclear today how the bootstrap method sets up webdrivers, it would be good to be able to provide your own webdriver instance in many cases (newer drivers, custom drivers, parallelll tests).
We have the following setup:
We have some tests
We run nunit 3 because it supports parallell execution
We use browserstack so all our tests are running towards clean instances
We have a base fixture like this:
[TestFixture("Edge", "12.0", "Windows", "10", "TestData.json")]
[TestFixture("IE", "11.0", "Windows", "8.1", "TestData.json")]
[TestFixture("Chrome", "47.0", "Windows", "8.1", "TestData.json")]
[TestFixture("Firefox", "43.0", "Windows", "8.1", "TestData.json")]
[Parallelizable(ParallelScope.Fixtures)]
public class BaseTestFixture : FluentTest
{
public string Browser { get; set; }
public string BrowserVersion { get; set; }
public string Os { get; set; }
public string OsVersion { get; set; }
public string TestDataPath { get; set; }
public Dictionary<string, object> Capabilities { get; set; }
public BaseTestFixture(string browser, string browserVersion, string os, string osVersion, string testDataPath)
{
Browser = browser;
BrowserVersion = browserVersion;
Os = os;
OsVersion = osVersion;
TestDataPath = Path.Combine(@".\Data", testDataPath);
}
[SetUp]
public void Init()
{
ReadTestData();
Capabilities = GetCapabilitites();
SeleniumWebDriver.Bootstrap(
BrowserStack.Uri,
Capabilities);
LogCapabilities();
// Setup settings
FluentSettings.Current.ExpectIsAssert = true;
// Navigate to root page to initialize the provider
I.Open(new Uri(string.Format(TestHelper.BaseUrl, TestData.customer.domain.Value)));
// Show session state
LogCookies();
}
...
I expected each test having it's own driver using this, but it doesn't seem like it since fluentautomaiton is using the TinyIoCContainer.
Would it be possible to have some initialization like this and for fluentautomation to not use any static state sharing between instances?
Researching a bit further I checked the bootstrap code and there you seems to be generating new driver instances per browser name (depending on which of the bootstap overloads you use).
It would be good to be able to specify your own identifier to support parallell runs. For example: myContextBasedOnParallellRun could be created from a combination of browser, versions, and os to enable parallell remote runs using nunit.
myContextBasedOnParallellRun = "FF-43-WIN-8"; // build this from the nunit attributes or some other parallell metadata instead of just browser name
container.Register<IWebDriver>((c, f) => new EnhancedRemoteWebDriver(BrowserStack.Uri, desiredCapabilities, defaultCommandTimeout), myContextBasedOnParallellRun);
It's unclear today how the bootstrap method sets up webdrivers, it would be good to be able to provide your own webdriver instance in many cases (newer drivers, custom drivers, parallelll tests).
We have the following setup:
We have a base fixture like this:
I expected each test having it's own driver using this, but it doesn't seem like it since fluentautomaiton is using the TinyIoCContainer.
Would it be possible to have some initialization like this and for fluentautomation to not use any static state sharing between instances?
The text was updated successfully, but these errors were encountered: