【问题标题】:Properties of IWebElement are not visible in VisualStudio 2013WebElement 的属性在 Visual Studio 2013 中不可见
【发布时间】:2015-10-06 07:25:56
【问题描述】:

我使用 Selenium WebDriver C# 和 PageFactory (PageObject) 模式来创建自动化测试。我在 Visual Studio 2013 中开发它们。

在最新版本的 Webdriver 之前(现在我使用 2.47.0)它运行良好,但现在我面临下一个问题:我无法查看我的 Web 元素的属性。

这是我创建和初始化元素的方式:

public class MyPageObj : DriverCover
{
        public MyPageObj(IWebDriver driver) : base(driver)
        {
            //'Driver' is a EventFiringWebDriver (IWebDriver) from parent class
            PageFactory.InitElements(Driver, this);
        }

        [FindsBy(How = How.CssSelector, Using = "#internal")]
        private IWebElement _myElement;
}

当我运行测试并在断点处我想查看 _myElement 的属性时,我只看到非公共成员:http://prntscr.com/8o075p

如果我不使用 PageFactory 并使用 Driver.FindElement(By.How()) 方法查找元素,它工作得很好。

【问题讨论】:

    标签: c# visual-studio selenium-webdriver


    【解决方案1】:

    正如我在此提交中发现的 https://github.com/SeleniumHQ/selenium/commit/689276b5e39c414edccf8a1bd11d71fd81b5fad4 进行了一些更改,这就是为什么我的问题不是错误并且不会被修复(

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-27
      • 1970-01-01
      • 2010-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多