我是一名初学者,在测试中遇到问题。如果我使用属性FindsBy
,如何正确使用ReadOnlyCollection<IWebElement>
。开始测试后,我的收藏始终为空。继承人是我在C#代码:Selenium:FindsBy with collection
[FindsBy(How = How.Name, Using = "role")]
public ReadOnlyCollection<IWebElement> radPercentage { get; }
这里是测试网络:http://testwisely.com/demo/survey
我想要做这样的事情:radPercentage[2].Click();
你们说的IList作品完美...谢谢 –
Deyeth
一旦页面元素初始化,你可以通过使用'PageFactory.InitElements(driver,radPercentage)''刷新一个特定的元素? –
刷新元素不仅需要再次调用该方法,还需要访问该页面。不知道是否有快捷方式。 – derloopkat