public static void Main(string[] args) { INavigation navigation = _webDriver.Navigate(); navigation.GoToUrl("https://digital-christmas-card.ballatoilet.repl.co/"); var submitButton = new ChromeWebElement(ChromeDriver, "SubmitButton"); var resetButton = new ChromeWebElement(ChromeDriver, "ResetButton"); var input = new ChromeWebElement(ChromeDriver, "NameInput"); var nameBar = new ChromeWebElement(ChromeDriver, "NameBar"); input.SendKeys("Test"); submitButton.Click(); var test = "Test"; test.Equals(nameBar.Text); }
public void TestCal() { ChromeWebElement two = appdriver.FindElementById(digit_2); two.Click(); ChromeWebElement plus = appdriver.FindElementById(op_add); plus.Click(); ChromeWebElement eight -appdriver.FindElementById(digit_8); eight.Click(); ChromeWebElement eq = appdriver.FindElementById(eq); eq.Click(); //locate the edit box of the calculator by using By.tagName() ChromeWebElement results = appdriver.FindElementById(result)); //Check the calculated value on the edit box assert results.getText().equals("10"):"Actual value is : " + results.getText() + " did not match with expected value: 6"; Assert.Pass(); }