-
Notifications
You must be signed in to change notification settings - Fork 131
Performance measures
Jakub Raczek edited this page Apr 25, 2019
·
10 revisions
Our framework allows you to measure time any of test step and displays average and 90 Percentile action time. These action time can be displayed as additional tests. That functionality together with JMeter and Teamcity can be used for measuring performance of a web application on the client and server side. More details can be found here.
Example of performance test:
namespace Ocaramba.Tests.NUnit.Tests
{
using Automation.Tests.PageObjects.PageObjects.TheInternet;
using global::NUnit.Framework;
/// <summary>
/// Tests to test framework
/// </summary>
[TestFixture]
[Parallelizable(ParallelScope.Fixtures)]
public class PerformanceTestsNUnit : ProjectTestBase
{
[Test]
[Repeat(3)]
public void HerokuappPerfTests()
{
this.DriverContext.PerformanceMeasures.StartMeasure();
InternetPage internet = new InternetPage(this.DriverContext);
internet.OpenHomePage();
this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingMainPage");
this.DriverContext.PerformanceMeasures.StartMeasure();
internet.GoToCheckboxesPage();
this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingCheckboxesPage");
}
}
}
Results of performance measures must be printed in ProjectTestBase class, more details here. Our framework supports only displaying performance results in TeamCity and AppVeyor. Below example of how use it for NUnit.
/// <summary>
/// After the class.
/// </summary>
[OneTimeTearDown]
public void AfterClass()
{
PrintPerformanceResultsHelper.PrintAverageDurationMillisecondsInAppVeyor(this.DriverContext.PerformanceMeasures);
PrintPerformanceResultsHelper.PrintPercentiles90DurationMillisecondsInAppVeyor(this.DriverContext.PerformanceMeasures);
PrintPerformanceResultsHelper.PrintAverageDurationMillisecondsInTeamcity(this.DriverContext.PerformanceMeasures);
PrintPerformanceResultsHelper.PrintPercentiles90DurationMillisecondsinTeamcity(this.DriverContext.PerformanceMeasures);
this.DriverContext.Stop();
}
Performance printing class API can be found here.
- 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