【发布时间】:2021-11-21 09:32:29
【问题描述】:
非常困在这个谜题中:
来源页面为:https://obstaclecourse.tricentis.com/Obstacles/41040
到目前为止我尝试的是:
*** Settings ***
Library Browser
#Library String
# title = CLICK ME IF YOU CAN
*** Variables ***
*** Test Cases ***
Example Test 70310
OPEN BROWSER https://obstaclecourse.tricentis.com/Obstacles/41040
#${txt}= GET TEXT //span[contains(text(),'Table contains')]
#CLICK //*[contains(text(),'Click me if you can')][1]
#
#CLICK //*[contains(text(),'Click me if you can')][1] delay=100ms clickCount=2
#CLICK id=buttonclick
CLICK xpath=//input[@id='buttontoclick'] clickCount=2
MOUSE BUTTON left
#//div[@id='']//div[@id='']
#//div[@id='']//*[contains(text(),'Click me if you can')]
Get Text xpath=//body *= You solved this automation problem.
# used resources (usefull) https://forum.katalon.com/t/two-objects-have-same-xpath/8713
FlurFunk 有一个使用 Tosca 的解决方案,可以在这里找到: https://www.youtube.com/watch?v=cdNRfvp_qHU
我还没有找到使用 RBFW 的解决方案,并且对所有尝试感到有点恼火。 这里的代码问题是:如何找到唯一元素?
【问题讨论】:
-
好吧,定位器是
//input[@value='Click me if you can']- 但这不足以解决它 - js 将鼠标移到元素上,这就是正常的 click() 所做的。 -
完全正确。所以我们需要另一种方式。可以在 Tosca 完成,我相信 RBFW 也可以完成,问题是“如何”?
标签: robotframework puzzle tosca