Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created September 5, 2021 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save executeautomation/865ed22a11956fbc88987cafadd6e283 to your computer and use it in GitHub Desktop.
Save executeautomation/865ed22a11956fbc88987cafadd6e283 to your computer and use it in GitHub Desktop.
[Theory]
[InlineData("admin", "password")]
[InlineData("admin", "password2")]
[InlineData("admin", "password3")]
[InlineData("admin", "password4")]
public void TestLoginWithFillData(string username, string password)
{
var driver = webDriverFixture.ChromeDriver;
testOutputHelper.WriteLine("First test");
driver
.Navigate()
.GoToUrl("http://eaapp.somee.com");
driver.FindElementByLinkText("Login").Click();
driver.FindElementById("UserName").SendKeys(username);
driver.FindElementById("Password").SendKeys(password);
var exception = Assert.Throws<NoSuchElementException>(
() => driver.FindElementByCssSelector(".btn-defaults")
.Click());
exception.Message
.Should()
.Contain("no such element: Unable");
testOutputHelper.WriteLine("Test completed");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment