RobotFramework + selenium无法点击img按钮

时间:2015-11-04 10:21:20

标签: python selenium automation robotframework

来自robotFramework的

测试用例:

        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>

为什么selenium只关注元素而不按按钮?

1 个答案:

答案 0 :(得分:2)

RadioButton不是 Button 。请改用Click ElementSelect Radio Button