2015-11-04 171 views
0

测试用例从robotFramework:RobotFramework +硒不能点击IMG按钮

 Wait Until Element Is Visible //input[@value='Data Solutions'] 
     Wait For Condition return window.document.querySelector('[value="Data 
    Solutions"]').style.visibility != "visible" 
     Click Button //input[@value='Data Solutions'] 
     Click Link css=input[value='Data Solutions'] + i 
     Wait Until Element Is Enabled  ${ticketServiceSelect} #next text input field should be enabled 

源html页面代码:

<div class="btn-group ng-pristine ng-untouched ng-valid" bs-radio-group="" data-toggle="buttons"> 
<label class="btn service-icon ng-binding ng-scope" btn-radio="'Data Solutions'" ng-repeat="service in serviceGroups.itsmServiceGroups" style=""> 
<input class="ng-pristine ng-untouched ng-valid" type="radio" value="Data Solutions" bs-radio="" ng-model="ticket.serviceGroup" name="75"> 
<i class="dna-icon dna-icon-data-solutions"></i> 
Data Solutions 
</label> 
</div> 

为什么硒只专注元素没有按下按钮上的?

+0

为什么你认为它不是按下按钮?你有错误吗?你有没有意想不到的行为?关键字是否表示点击过,但没有任何反应? –

回答

1

单选按钮是不是按钮。改为使用Click ElementSelect Radio Button

+0

我也尝试以下解决方法: '执行JavaScript window.document.querySelector( '[值= “数据解决方案”]')点击()'我 优良工程。谢谢! –