【发布时间】:2017-06-25 18:36:50
【问题描述】:
我正在尝试使用Robotframework(Python2.7,Selenium2Library) 选择一个单选按钮。
我有以下代码:
<div id="dt_method_cashondelivery" class="u-border-b-dotted u-space-pt-10
u-space-pb-5">
<input id="p_method_cashondelivery" class="Form-check-toggle"
type="radio"title="Cash On Delivery" name="payment[method]"
value="cashondelivery"/>
<label class="Form-radio" for="p_method_cashondelivery">
<span>Cash On Delivery </span>
</label>
</div>
我使用的机器人框架代码是:
Select Radio Button payment[method] cashondelivery
有什么想法吗?
【问题讨论】:
-
明确说明问题。你有什么错误吗?
-
你用什么代码来点击单选按钮?
-
我使用了带有参数 groupname=payment[method] 和 value=cashondelivery 的选择单选按钮。
-
我收到以下错误:ValueError: Element locator 'xpath=//input[@type='radio' and @name='payment[method]' and (@value='cashondelivery' or @id='cashondelivery')]' 没有匹配任何元素。
-
好的,我会和我的开发团队谈谈,看看我们是否可以修改代码中的某些内容。无论如何,非常感谢你的帮助。祝你有美好的一天。
标签: python-2.7 radio-button automated-tests robotframework