Skip to content

Instantly share code, notes, and snippets.

@muditlambda
Created February 8, 2021 18:57
Show Gist options
  • Save muditlambda/87866d31e8c979766ec74a5b20430dab to your computer and use it in GitHub Desktop.
Save muditlambda/87866d31e8c979766ec74a5b20430dab to your computer and use it in GitHub Desktop.
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();
}
..............................
..............................
}
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()
{
.....................................................
.....................................................
String site_title = brow.Title;
Console.WriteLine("The site title is " + site_title);
Assert.That(site_title, Is.Not.Empty);
Console.WriteLine("Title not empty, Test passed");
/* Perform wait to check the output */
System.Threading.Thread.Sleep(2000);
.....................................................
.....................................................
}
[TearDown]
public void close_Browser()
{
brow.Close();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment