我是 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。
方法1:
${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}
然而,这些方法都不起作用。有人可以帮我解决我做错了什么,或者建议一种新方法吗?
我可以使用 ID 在字段中输入文本,因此 Robot 至少可以找到该元素。