public void RemoteWebDriverExtendedTest() { //Starting a test with the following context tags. reportiumClient.TestStart("Reportium C# Test should success", new ReportiumTestContext("test 1", "c#", "should success")); reportiumClient.TestStep("Navigate to google and search PerfectoCode GitHub"); //Test step will be shown on the report ui driver.Navigate().GoToUrl("https://www.google.com"); //locate the search bar and sendkeys driver.FindElementByName("q").SendKeys("PerfectoCode GitHub"); //click on the search button driver.FindElementByXPath("//*[@aria-label='Google Search']").Click(); reportiumClient.TestStep("Choose first result and validate title"); //Add as many test steps as you want // driver.FindElementByCssSelector("#rso > div > div:nth-child(1) > div > div > div._OXf > h3 > a").Click(); var keyword = "Perfecto"; //a keyword to validate Assert.IsTrue(driver.FindElementByPartialLinkText(keyword).Displayed); //assert that Keyword is in the page title // Assert.IsTrue(driver.Title.Contains(keyword)); }
public static void beforeStep() { reportingClient.TestStep(ScenarioStepContext.Current.StepInfo.Text); }