Selenium WebDriver Recipes in C# by Courtney Zhan

Selenium WebDriver Recipes in C# by Courtney Zhan

Author:Courtney Zhan
Language: eng
Format: epub
ISBN: 9798868800238
Publisher: Apress


driver.FindElement(By.Name("person_name")).Click();

driver.FindElement(By.Id("tip")).Text.Equals("Max 20 characters");

Invoke JavaScript Events Such As OnChange

A generic way to invoke OnXXXX events is to execute JavaScript. The following is an example of invoking an OnChange event on a text box.driver.Navigate().GoToUrl(TestHelper.SiteUrl() + "/select_list.html");

driver.FindElement(By.Id("person_name_textbox")).Clear();

driver.FindElement(By.Id("person_name_textbox")).SendKeys("Wise Tester too");

((IJavaScriptExecutor) driver).ExecuteScript("$('#person_name_textbox').trigger('change')");

Assert.IsTrue(driver.FindElement(By.Id("person_name_label")).Text.Equals("Wise Tester too"));



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.