Best Ocaramba code snippet using Ocaramba.Tests.PageObjects.PageObjects.TheInternet.FormAuthenticationPage.LogOn
HerokuappTestsDataDrivenNUnit.cs
Source:HerokuappTestsDataDrivenNUnit.cs
...37 new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage();38 var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);39 formFormAuthentication.EnterUserName(parameters["user"]);40 formFormAuthentication.EnterPassword(parameters["password"]);41 formFormAuthentication.LogOn();42 Verify.That(43 this.DriverContext,44 () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessage));45 }46 [Test]47 [TestCaseSource(typeof(TestData), "CredentialsExcel")]48 public void FormAuthenticationPageExcelTest(IDictionary<string, string> parameters)49 {50 new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage();51 var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);52 formFormAuthentication.EnterUserName(parameters["user"]);53 formFormAuthentication.EnterPassword(parameters["password"]);54 formFormAuthentication.LogOn();55 Verify.That(56 this.DriverContext,57 () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessage));58 }59 [Test]60 [TestCaseSource(typeof(TestData), "CredentialsCSV")]61 public void CSVTest(IDictionary<string, string> parameters)62 {63 new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage();64 var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);65 formFormAuthentication.EnterUserName(parameters["user"]);66 formFormAuthentication.EnterPassword(parameters["password"]);67 formFormAuthentication.LogOn();68 Verify.That(69 this.DriverContext,70 () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessage));71 }72 [Test]73 [TestCaseSource(typeof(TestData), "LinksSetTestName")]74 public void CountLinksAndSetTestNameAtShiftingContentTest(IDictionary<string, string> parameters)75 {76 new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage();77 var links = new ShiftingContentPage(this.DriverContext);78 Verify.That(this.DriverContext, () => Assert.AreEqual(parameters["number"], links.CountLinks()));79 }80 [Test]81 [TestCaseSource(typeof(TestData), "LinksExcel")]...
FormAuthenticationPage.cs
Source:FormAuthenticationPage.cs
...73 {74 Logger.Info(CultureInfo.CurrentCulture, "User name '{0}'", userName);75 this.Driver.GetElement(this.userNameForm).SendKeys(userName);76 }77 public void LogOn()78 {79 Logger.Info(CultureInfo.CurrentCulture, "Click on Login Button");80 this.Driver.GetElement(this.loginButton).JavaScriptClick();81 }82 }83}...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!