How To Use Asserts In NUnit Using Selenium?

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • php-selenium-sample

    Run PHP and Selenium scripts on LambdaTest automation cloud. A sample repo to help you run PHP based test scripts in parallel with LambdaTest

    using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.IE; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assert_Demo { public class Browser_ops { IWebDriver webDriver; public void Init_Browser() { webDriver = new ChromeDriver(); webDriver.Manage().Window.Maximize(); } public string Title { get { return webDriver.Title; } } public void Goto(string url) { webDriver.Url = url; } public string Geturl { get { return webDriver.Url; } } public void Close() { webDriver.Quit(); } public IWebDriver getDriver { get { return webDriver; } } } class Assert_Demo_1 { Browser_ops brow = new Browser_ops(); String test_url = "https://www.lambdatest.com"; [SetUp] public void start_Browser() { brow.Init_Browser(); } [Test] public void test_asserturl() { brow.Goto(test_url); System.Threading.Thread.Sleep(4000); String actual_url = brow.Geturl; Console.WriteLine("url " + actual_url); // Raise an assert if the URL's match // The URL on which testing is done is "https://www.lambdatest.com" // Whereas the get URL will return "https://www.lambdatest.com/" // Hence the above test will pass Assert.That(actual_url, Is.Not.EqualTo(test_url)); Console.WriteLine("Test Passed"); /* Perform wait to check the output */ System.Threading.Thread.Sleep(2000); } [TearDown] public void close_Browser() { brow.Close(); } } }

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts