【发布时间】:2014-05-11 01:00:30
【问题描述】:
我尝试过使用 WebElement(和 IWebElement)和字符串列表,但我不断收到错误消息。如何按类名获取所有元素文本的列表或字符串?我有所有 Selenium 参考资料。我需要一些 java.util dll 吗?
我应该实现一个 foreach 循环吗?
IList<IWebElement> all = new IList<IWebElement>();
all = driver.FindElements(By.ClassName("comments")).Text;
错误:无法创建抽象类或接口“System.Collections.Generic.IList”的实例
错误:“System.Collections.ObjectModel.ReadOnlyCollection”不包含“Text”的定义,并且没有扩展方法“Text”接受类型的第一个参数
【问题讨论】:
标签: c# list selenium selenium-webdriver