【发布时间】:2012-04-06 08:52:31
【问题描述】:
我尝试自动化的网站可以通过使用站点地图树进行导航。现在为了从 selenium 访问子节点,我编写了以下代码:
IWebElement menu = driver.FindElement(By.LinkText("Setup"));
//Setup is the parent node
Actions mouseOver = new Actions(driver);
mouseOver.MoveToElement(menu).Build().Perform();
driver.FindElement(By.LinkText("Entities")).Click();
//Entities is the child node.
但是 webdriver 会抛出 Element not found 异常。
我正在使用 Firefox 来播放测试用例。
【问题讨论】:
-
经典 asp 不是 ASP.NET,C# 从来都不是它的选择。请使用正确的标签。
标签: c# selenium webdriver sitemap