CloudBeat Docs
HomeRequest a DemoContactSign In
  • What is CloudBeat?
  • Get Started
    • Quick Start
  • SUPPORTED FRAMEWORKS
    • Java JUnit
    • .NET MSTest
    • Playwright (JS/TS)
  • Fundamentals
    • Creating Projects
    • Creating Environments
    • Creating Tests Cases
    • Running Tests Cases
    • Creating Tests Suites
    • Running Tests Suites
    • Creating Releases
    • Adding Apps
  • Sample Projects
    • Introduction to Cloudbeat sample projects
    • Oxygen Cucumber project
    • Oxygen project
    • TestNG project
  • Features
    • Integrations
      • CI/CD Pipeline
        • Jenkins
        • Azure DevOps
      • Cloud Providers
        • Genymotion
        • Applitools
        • Perfecto
    • Supported Frameworks
    • Data-Driven Testing
      • DDT - Oxygen Framework
  • CloudBeat Synthetic
    • What is CloudBeat Synthetic?
    • Creating your first monitor
    • Review general monitor results
    • Review specific monitor dashboard
    • Create SLA
    • Create Reports & Alerts
    • Changing Runtime Setting
    • Run Monitors
    • Maintenance
    • Incidents
    • Full Monitor Test - Example
  • Settings & Administration
    • Managing Notification Groups
    • Managing Permissions
    • Managing Users
    • Managing Account
    • Managing My Profile
  • References
    • Active Runs
    • Test Results
    • Projects
      • Oxygen Project
      • Cucumber + Java Project
      • .Net Project
      • TestNG Project Setup
    • Reports
Powered by GitBook
On this page
  • Installation
  • Install a specific version of a package
  • Initialization
  • Applying CBStep Attribute in your test cases
  • Create Binaries
  • Creating MSTest project in Cloudbeat
  • Running Test Cases

Was this helpful?

  1. SUPPORTED FRAMEWORKS

.NET MSTest

Installation

We need to include the MSTest kit by using:

dotnet add package CloudBeat.Kit.MSTest

Install a specific version of a package

dotnet add package CloudBeat.Kit.MSTest --version 4.7.0

Initialization

import:

using CloudBeat.Kit.MSTest;

Inherit the CbTest class and wrap the webdriver:

namespace CbExamples.MSTest.Infra
{
    [TestClass]
    public abstract class WebDriverTest : CbTest
    {
        private IWebDriver _driver = null;

        public EventFiringWebDriver Driver { get; private set; }

        [TestInitialize]
        public void SetUpWebDriver()
        {
            ChromeOptions options = new ChromeOptions();
            _driver = new ChromeDriver(options);
            Driver = new EventFiringWebDriver(_driver);
            CbMSTest.WrapWebDriver(Driver);
        }
    }
}

Applying CBStep Attribute in your test cases

Import:

using CloudBeat.Kit.MSTest.Attributes;

Use attribute [CBStep] to describe your test case:

[CbStep("Open \"Login\" page")]
public void Open()
{
    driver.Navigate().GoToUrl(baseUrl ?? DEFAULT_BASE_URL);
}

You can also use variables in the step description, to do that we'll put username in curly braces:

[CbStep("Type \"{username}\" in \"Username\" field")]
public void EnterUsername(string username)
{
	var usernameFld = UsernameField;
	if (usernameFld == null)
	   Assert.Fail("Username field not found");
	usernameFld.Click();
	usernameFld.SendKeys(username);
}

Create Binaries

Before uploading our project to CloudBeat, we have to create a binaries zip folder, in your project folder open cmd and run the following command:

dotnet build

a bin folder should be created, now go to bin -> debug and create a zip from net.6.0

Creating MSTest project in Cloudbeat

Go to projects tab and create a new project and choose MSTest - Binaries

Decide who will have accessibility to this project

Upload the binaries as a zip

Add assembly names and finish

And that's how you have a new MSTest project

Running Test Cases

Go to Cases under Testing tab, there you will see all your test cases

Select a browser to run your test on, save changes and run

You will see the results based on the [CbSteps] that were added in your project

PreviousJava JUnitNextPlaywright (JS/TS)

Last updated 5 days ago

Was this helpful?

Projects
Running Tests Cases