-
-
Save muditlambda/0336d70bf58f658e88bae3da3263fe29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
using System.Text.RegularExpressions; | |
namespace Assert_Demo | |
{ | |
class Assert_Demo_1 | |
{ | |
String test_url = "https://accounts.lambdatest.com/login"; | |
IWebDriver webDriver; | |
[SetUp] | |
public void start_Browser() | |
{ | |
webDriver = new ChromeDriver(); | |
webDriver.Manage().Window.Maximize(); | |
} | |
[Test] | |
public void test_null() | |
{ | |
String user_name_xpath = "//*[@id='app']/section/form/div/div/input[1]"; | |
webDriver.Url = test_url; | |
System.Threading.Thread.Sleep(4000); | |
//IWebElement submit_element = webDriver.FindElement(By.XPath("//*[@id='app']/section/form/div/div/button")); | |
IWebElement user_name_element = webDriver.FindElement(By.XPath(user_name_xpath)); | |
user_name_element.SendKeys("abc@gmail.com"); | |
String user_name = user_name_element.GetAttribute("value"); | |
Console.WriteLine("User Name" + user_name); | |
Assert.That(user_name, Is.Empty); | |
// submit_element.Submit(); | |
/* Perform wait to check the output */ | |
System.Threading.Thread.Sleep(2000); | |
} | |
[TearDown] | |
public void close_Browser() | |
{ | |
webDriver.Quit(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment