-1

非常困在这个谜题中:

源页面是: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 的解决方案,并且对所有尝试感到有点恼火。这里的代码问题是:如何找到唯一元素?

4

1 回答 1

1

知道了!!!最后

 ${ele}    Get WebElement    //input[@id='buttontoclick']
    Execute Javascript    arguments[0].click();     ARGUMENTS    ${ele} 
    ELEMENT TEXT SHOULD BE    xpath=//body    You solved this automation problem.
   

    # (notice the last comment on the following page: )
    # used resources  https://stackoverflow.com/questions/48181988/robot-framework-click-element-using-execute-javascript
    # used resources  https://www.youtube.com/watch?v=1isRH9E9WAE  ;)
于 2021-09-29T14:39:50.393 回答