Robot Framework+selenium无法点击图片按钮
RobotFramework+selenium cannot click the img button
来自 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 只关注元素而不按下按钮?
RadioButton 不是 Button。请改用 Click Element
或 Select Radio Button
。
来自 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 只关注元素而不按下按钮?
RadioButton 不是 Button。请改用 Click Element
或 Select Radio Button
。