How to press "Enter" in Selenium WebDriver (Nunit test case) written in C #?

I am trying to create an automation infrastructure with nunit + Selenium + C #

Our webadmin is based on the Devexpress platform, so I can’t click the "ID" button, or at least I don’t know how to do it. The subtitle for this just presses the "Enter" button. I have already tried

driver.FindElement(By.XPath("String")).SendKeys(Keys.Enter); 
+4
source share
3 answers
 using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); builder.SendKeys(Keys.Enter); 

For more information: Enter input / return in Selenium

+1
source

RON, there is a possibility that the DOM will take some time to load after calling GoToUrl. Increase the implicit wait time so that findElement waits more time before throwing any exception. Or use explicitly wiat --- http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp

If this does not work, use the Actions class - http://www.guru99.com/keyboard-mouse-events-files-webdriver.html

0
source

Use the code below to click an invisible button.

  IWebElement tmpElement = Driver.FindElement(By.Id("invisibleButton")); var executor = (IJavaScriptExecutor)Driver; executor.ExecuteScript("arguments[0].click();", tmpElement); wait.Until(d => { return d.Title.Equals("pageTitle"); }); 
0
source

Source: https://habr.com/ru/post/1490520/


All Articles