【问题标题】:MbUnit Gallio WatiN Right-Click Testing on a linkMbUnit Gallio WatiN 链接上的右键单击测试
【发布时间】:2013-06-11 15:41:44
【问题描述】:

我想使用 MbUnit、Gallio 和 WatiN 测试右键单击链接。目前我看不出有什么方法可以做到这一点。似乎没有我可以从框架中调用的右键单击方法。我确信有一种解决方法,但我目前无法找到。

【问题讨论】:

    标签: watin right-click mbunit gallio


    【解决方案1】:

    在WatiN中,你可能需要直接触发事件,比如

    myElement.FireEvent("oncontextmenu")
    

    还请看: WatiN FireEvent not passing event properties in FireFox

    在 selenium WebDriver 中,您可以使用 Actions 类。 在 C# 中,

    IWebElement element = driver.FindElement(By.LinkText("LinkText"));
    Actions actioner = new Actions(driver);
    actioner.MoveToElement(elem).ContextClick(elem).Perform();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 2014-01-29
      相关资源
      最近更新 更多