我正在尝试设置页面的Selenium测试,但无法让它单击单选按钮
我正在尝试使用IWebDriver xpath方法
<fieldset class="radio-button-list">
<label >
<span class="className">Text1</span>
<input type="radio" value="Button1">
</label>
<label>
<span class="className">Text2</span>
<input type="radio" value="Button2">
</label>
</fieldset>
这就是我要用的..。
driver.FindElement(By.XPath("//button[contains(text(),'Text2')]")).Click();
我希望它点击单选按钮,但我得到了这个错误:
OpenQA.Selenium.NoSuchElementException: 'no such element: Unable to locate element: {"method":"xpath","selector":"//button[contains(text(),'Text2')]"}
https://stackoverflow.com/questions/56655667
复制相似问题