无法使用 Robot Framework 检查文本字段条目
Unable to check text field entry using Robot Framework
我是 Robot Framework 的新手,我正在尝试检查我的文本字段是否包含正确的条目。
如您在上面的屏幕截图中所见,我的地址字段之一是南波士顿。 html 是:
<input id="profileDeliveryAddressAddress2" class="small ng-pristine ng-valid ng-not-empty ng-valid-maxlength ng-touched" type="text" ng-model="user.delivery_address.address1" maxlength="30" aria-invalid="false"></div>
我尝试了以下方法来检查文本 South Boston。
方法一:
${addressText} Get Text id=profileDeliveryAddressAddress2
Should Be Equal As Strings ${addressText} South Boston
方法二
${addressText} Get Value id=profileDeliveryAddressAddress2
Should Be Equal As Strings ${addressText} South Boston
方法三
${expected_text} South Boston
${addressText}= Get Value id=profileDeliveryAddressAddress2
Should Be Equal ${search text} ${addressText}
方法四
${expected_text} South Boston
${addressText}= Get Text id=profileDeliveryAddressAddress2
Should Be Equal ${search text} ${addressText}
但是 none 这些方法都有效。有人可以帮我解决我做错的事情,或者建议一种新方法吗?
我可以使用 ID 在字段中输入文本,因此 Robot 至少找到了元素。
想通了。使用了以下内容:
Textfield Value Should Be id=profileDeliveryAddressAddress2 South Boston
我是 Robot Framework 的新手,我正在尝试检查我的文本字段是否包含正确的条目。
如您在上面的屏幕截图中所见,我的地址字段之一是南波士顿。 html 是:
<input id="profileDeliveryAddressAddress2" class="small ng-pristine ng-valid ng-not-empty ng-valid-maxlength ng-touched" type="text" ng-model="user.delivery_address.address1" maxlength="30" aria-invalid="false"></div>
我尝试了以下方法来检查文本 South Boston。
方法一:
${addressText} Get Text id=profileDeliveryAddressAddress2
Should Be Equal As Strings ${addressText} South Boston
方法二
${addressText} Get Value id=profileDeliveryAddressAddress2
Should Be Equal As Strings ${addressText} South Boston
方法三
${expected_text} South Boston
${addressText}= Get Value id=profileDeliveryAddressAddress2
Should Be Equal ${search text} ${addressText}
方法四
${expected_text} South Boston
${addressText}= Get Text id=profileDeliveryAddressAddress2
Should Be Equal ${search text} ${addressText}
但是 none 这些方法都有效。有人可以帮我解决我做错的事情,或者建议一种新方法吗?
我可以使用 ID 在字段中输入文本,因此 Robot 至少找到了元素。
想通了。使用了以下内容:
Textfield Value Should Be id=profileDeliveryAddressAddress2 South Boston