RON*_*345 7 c# nunit enter selenium-webdriver
我正在尝试使用nunit + Selenium + c#创建自动化框架
我们的webadmin基于Devexpress框架,因此我不能点击它的"ID"按钮或至少我不知道如何.对此的替代只需按"Enter"按钮即可.我已经尝试过了
driver.FindElement(By.XPath("String")).SendKeys(Keys.Enter);
Run Code Online (Sandbox Code Playgroud)
小智 6
using OpenQA.Selenium.Interactions;
Actions builder = new Actions(driver);
builder.SendKeys(Keys.Enter);
Run Code Online (Sandbox Code Playgroud)
有关更多信息:在 Selenium 中键入 Enter/Return 键
RON,在 GoToUrl 调用之后 DOM 可能需要一些时间来加载。增加隐式等待时间,以便 findElement 在引发任何异常之前等待更多时间。或者使用显式 wiat --- http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
如果这仍然不起作用,那么使用 Actions 类 - http://www.guru99.com/keyboard-mouse-events-files-webdriver.html
| 归档时间: |
|
| 查看次数: |
19271 次 |
| 最近记录: |