-
Notifications
You must be signed in to change notification settings - Fork 131
Selenium Parallel tests execution
Jakub Raczek edited this page May 12, 2016
·
16 revisions
Our framework supports parallel test execution, how to enable it in your test project depends on selected Unit framework:
you have to add the attribute to the test classes ParallelScope.Fixtures indicates that fixtures may be run in parallel with one another.
namespace Objectivity.Test.Automation.Tests.NUnit.Tests
{
using System.Collections.Generic;
using global::NUnit.Framework;
using Objectivity.Test.Automation.Common;
using Objectivity.Test.Automation.Tests.NUnit.DataDriven;
using Objectivity.Test.Automation.Tests.PageObjects.PageObjects.TheInternet;
[TestFixture]
[Parallelizable(ParallelScope.Fixtures)]
public class HerokuappTestsNUnit : ProjectTestBase
{
[Test]
public void BasicAuthTest()
{
var basicAuthPage =
new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage();
Verify.That(
this.DriverContext,
() =>
Assert.AreEqual(
"Congratulations! You must have the proper credentials.",
basicAuthPage.GetCongratulationsInfo));
}
}
}
namespace Objectivity.Test.Automation.Tests.NUnit.Tests
{
using global::NUnit.Framework;
using Objectivity.Test.Automation.Tests.PageObjects.PageObjects.TheInternet;
[TestFixture]
[Parallelizable(ParallelScope.Fixtures)]
public class JavaScriptAlertsTestsNUnit : ProjectTestBase
{
[Test]
public void ClickJsAlertTest()
{
var internetPage = new InternetPage(this.DriverContext).OpenHomePage();
var jsAlertsPage = internetPage.GoToJavaScriptAlerts();
jsAlertsPage.OpenJsAlert();
jsAlertsPage.AcceptAlert();
Assert.AreEqual("You successfuly clicked an alert", jsAlertsPage.ResultText);
}
}
}
More info about NUnit Framework Parallel Test Execution
how set parallel test execution depends on Visual Studio version you using or test runner version. One of solution is to use Testsettings.testsettings file.
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="164f37f6-b408-4a43-9caa-97fe6ccd4dc4" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false"/>
<Execution parallelTestCount = "2">
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>
More details can be find here how to run unit tests mstest in parallel
Please notice that Selenium IEDriver doesn't support test execution in parallel.
- Home
- Getting started
- Parallel tests execution
- MsTest DataDriven tests from Xml and CSV files
- NUnit DataDriven tests from Xml, CSV and Excel files
- Comparing files by NUnit DataDriven tests
- Visual Testing
- Screen shots: full desktop, selenium. PageSource saving
- Verify-asserts without stop tests
- Downloading files
- Helpers
- Override browser profile preferences, install browser extensions, Headless mode
- Debugging Test.Automation framework
- Logging
- Performance measures
- Webdriver Extends
- More common locators
- Selenium-Grid-support
- Advanced Browser Capabilities and Options
- AngularJS synchronization
- Update App.config or appsettings.json
- Cross browser parallel test execution with testing-Cloud-Providers\SeleniumGrid
- Verifying Javascript Errors from browser
- Enabling Performance Log for Chrome
- Azure DevOps Support
- Edge browser Support
- Downloading and running Selenium Grid with Powershell
- Run Ocaramba tests with Docker container
- HTTP auth in Internet explorer
- ExtentReports Support