我已经尝试过使用WebElement(和IWebElement)和字符串列表,但我一直在收到错误.如何通过classname获取所有元素文本的列表或字符串?我有所有Selenium参考.我需要一些java.util dll吗?
我应该实现foreach循环吗?
IList<IWebElement> all = new IList<IWebElement>();
all = driver.FindElements(By.ClassName("comments")).Text;
Run Code Online (Sandbox Code Playgroud)
错误:无法创建抽象类或接口'System.Collections.Generic.IList'的实例
错误:'System.Collections.ObjectModel.ReadOnlyCollection'不包含'Text'的定义,也没有扩展方法'Text'接受类型的第一个参数