Hi
Does the Telerik test framework support running tests in parallel or is that a path with a road block in the end? :)
So far I've come up with this, but it doesn't really work and i can't figure out if it's just not going to work with Telerik or if I'm doing something wrong.
The last test can just be repeated a couple of times and i have DegreeOfParalallism = 2 in AssemblyInfo.cs
I'm in the process of investigating different ways of making our suite run faster, looking forward to your response.
Does the Telerik test framework support running tests in parallel or is that a path with a road block in the end? :)
So far I've come up with this, but it doesn't really work and i can't figure out if it's just not going to work with Telerik or if I'm doing something wrong.
The last test can just be repeated a couple of times and i have DegreeOfParalallism = 2 in AssemblyInfo.cs
I'm in the process of investigating different ways of making our suite run faster, looking forward to your response.
[TestFixture]
[Parallelizable(TestScope.Descendants)]
public
class
TelerikMbUnit1 : BaseTest
{
ConcurrentDictionary<
string
, Browser> browserDict =
new
ConcurrentDictionary<
string
, Browser>();
#region [ Setup / TearDown ]
[SetUp]
public
void
MyTestInitialize()
{
Initialize(
false
);
// Launch new browser
Manager.LaunchNewBrowser(BrowserType.FireFox,
true
);
Browser browser = Manager.ActiveBrowser;
browserDict.TryAdd(TestContext.CurrentContext.TestStep.ToString(), browser);
}
[TearDown]
public
void
MyTestCleanUp()
{
// this.CleanUp();
Browser browser;
browserDict.TryRemove(TestContext.CurrentContext.TestStep.ToString(),
out
browser);
browser.Close();
}
[FixtureTearDown]
public
void
FixtureCleanup()
{
// This will shut down all browsers if
// recycleBrowser is turned on. Else
// will do nothing.
ShutDown();
}
#endregion
[Test]
public
void
SampleWebAiiTest0()
{
Browser browser = browserDict.Where(d => d.Key == TestContext.CurrentContext.TestStep.ToString()).Single().Value;
// The active browser
browser.NavigateTo(
"http://www.google.dk"
);
// Find the google search box and set it to "Telerik";
browser.Find.ByName<HtmlInputText>(
"q"
).Text =
"Telerik"
;
// Click the Search button
browser.Find.ByName<HtmlButton>(
"btnK"
).Click();
// Validate the search contain the 'Telerik' text
Assert.IsTrue(browser.ContainsText(
"Telerik"
));
}