我打算获取属性type="radio"
但我不知道如何在硒webdriver中。 我尝试用试图获得Selenium Webdriver中的特定属性
if(driver.findElement(By.id("userStatusEnable")).getAttribute("type").equals("radio"))
,并通过改变ID为x-AUTO-210
<div id="userStatusEnable" class="x-form-check-wrap x-form-field x-component " role="presentation" style="position: relative;">
<input id="x-auto-210" class=" x-form-radio" type="radio" name="gxt.RadioGroup.5" style="position: relative; left: 0px; top: 4px;" tabindex="0" value="enabled" aria-describedby="x-auto-190" checked="">
<label class="x-form-cb-label" for="x-auto-210" htmlfor="x-auto-210" style="position: relative; left: 1px; top: 3px;">Enable</label>
</div>
究竟是你想做些什么?用'type =“radio”'查找元素,或者验证在另一个选择器中找到的元素是否具有'type =“radio”'? – Richard 2014-09-18 18:36:03
是的,我试图验证该ID是类型的无线电。所以我必须确认,我现在正在处理的页面上有2个单选按钮,但我不知道如何获取属性。 – 2014-09-18 19:06:54