【发布时间】:2021-11-21 07:23:27
【问题描述】:
代码问题与页面有关:https://obstaclecourse.tricentis.com/Obstacles/41036
我目前使用的代码是:
*** Settings ***
Library Browser
Library String
# title = TABLE SEARCH
*** Variables ***
*** Test Cases ***
Example Test 70310
OPEN BROWSER https://obstaclecourse.tricentis.com/Obstacles/41036
${txt}= GET TEXT //span[contains(text(),'Table contains')]
#&{tostring}= CONVERT TO STRING ${txt}
# don't forget the spacebar
${endresult}= String.STRIP STRING ${txt} characters=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop"?() /
LOG TO CONSOLE ${endresult}
FILL TEXT xpath=//input[@id='resulttext'] ${endresult}
#${text}= GET TEXT id=randomTable
#LOG TO CONSOLE ${text}
Get Text xpath=//body *= You solved this automation problem.
# used resources
问题是将其简化为:包含“15”? (真/假(我不知道为什么会这样)
起初我以为我错过了空格键,所以我添加了那个,但它没有给出正确的最终结果。
【问题讨论】:
-
提示:您应该使用正则表达式来查找号码;提示 2:您应该在输入中输入单词“True”或“False”,而不是数字。
标签: string robotframework strip