public void SelectionSelectBySymbol() { driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("single_text_input.html"); IWebElement input = driver.FindElement(By.Id("textInput")); new Actions(driver).Click(input).SendKeys("abc def").Perform(); WaitFor(() => input.GetAttribute("value") == "abc def", "did not send initial keys"); if (!TestUtilities.IsInternetExplorer(driver)) { // When using drivers other than the IE, the click in // the below action sequence may fall inside the double- // click threshold (the IE driver has guards to prevent // inadvertent double-clicks with multiple actions calls), // so we call the "release actions" end point before // doing the second action. IActionExecutor executor = driver as IActionExecutor; if (executor != null) { executor.ResetInputState(); } } new Actions(driver).Click(input) .KeyDown(Keys.Shift) .SendKeys(Keys.Left) .SendKeys(Keys.Left) .KeyUp(Keys.Shift) .SendKeys(Keys.Delete) .Perform(); Assert.That(input.GetAttribute("value"), Is.EqualTo("abc d")); }
public void SelectionSelectByWord() { driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("single_text_input.html"); IWebElement input = driver.FindElement(By.Id("textInput")); new Actions(driver).Click(input).SendKeys("abc def").Perform(); WaitFor(() => input.GetAttribute("value") == "abc def", "did not send initial keys"); if (TestUtilities.IsFirefox(driver)) { // When using geckodriver, the click in the below action // sequence may fall inside the double-click threshold, // so we call the "release actions" end point before // doing the second action. IActionExecutor executor = driver as IActionExecutor; if (executor != null) { executor.ResetInputState(); } } new Actions(driver).Click(input) .KeyDown(Keys.Shift) .KeyDown(Keys.Control) .SendKeys(Keys.Left) .KeyUp(Keys.Control) .KeyUp(Keys.Shift) .SendKeys(Keys.Delete) .Perform(); WaitFor(() => input.GetAttribute("value") == "abc ", "did not send editing keys"); }
public void SetupTest() { IActionExecutor actionExecutor = driver as IActionExecutor; if (actionExecutor != null) { actionExecutor.ResetInputState(); } }
public void ReleaseModifierKeys() { // new Actions(driver).SendKeys(Keys.Null).Perform(); IActionExecutor actionExecutor = driver as IActionExecutor; if (actionExecutor != null) { actionExecutor.ResetInputState(); } }
public void Setup() { new Actions(driver).SendKeys(Keys.Null).Perform(); IActionExecutor actionExecutor = driver as IActionExecutor; if (actionExecutor != null) { actionExecutor.ResetInputState(); } }
public void SetupTest() { IActionExecutor actionExecutor = driver as IActionExecutor; if (actionExecutor != null) { actionExecutor.ResetInputState(); } driver.SwitchTo().DefaultContent(); ((IJavaScriptExecutor)driver).ExecuteScript("window.scrollTo(0, 0)"); }