Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  RPA Challenge website- how to create solid selectors

    Posted Tue June 01, 2021 01:32 PM
    Hello Everyone.

    I'm new to IBM RPA and I've found a difficulty which I'd be happy for your assistance with.
    I'm trying to create a bot which fill in the fields of the Rpa Challenge page and then click submit.

    My problem is to create a stable selector for each field. On this website, all the fields details (index, id, name etc.) are changing each time the website is being opened/ the submit button is being clicked (Please see the attachments). 

    I'd be happy for assistance with understanding how can I automate in this website, or if to be more specific- how to create solid selectors?

    Thanks in advance.

    ------------------------------
    Sarel Fisher
    ------------------------------


  • 2.  RE: RPA Challenge website- how to create solid selectors
    Best Answer

    Posted Tue June 08, 2021 08:19 AM
    Many thanks to Pedro Silva from ABP Consultancy which was able to find an easy solution for this problem.

    Solution:
    On each field there is a label which doesn't change, even when the "submit" button is being clicked: ng-reflect-name="labelFirstName".
    In order to use that as an identifier, we should follow these steps (a to e are just an explanation of how did we get to f- which is the solution):
    a. Right click on the input field
    b. Inspect
    c. Copy XPath
    d. Paste it inside the "Set value to field" activity
    e. Choose XPath
    f. Change the value from "//*[@id="JaEk0"]" to "//*[@ng-reflect-name="labelFirstName"]"

    Here is an example code:
    defVar --name count --type Numeric --value 0
    webStart --name browser --type "InternetExplorer"
    webNavigate --url "http://www.rpachallenge.com/"
    while --left "${count}" --operator "Less_Than" --right 3
        webSet --value "Some First Name" --selector "XPath" --xpath "//*[@ng-reflect-name=\"labelFirstName\"]"
        delay --timeout "00:00:05"
        webClick --selector "XPath" --xpath "//*[@value=\"Submit\"]"
        incrementVar --number ${count}
    endWhile
    webClose --name browser --leavebrowseropen


    Regards,

    Sarel.
    ​​​​​​

    ------------------------------
    Sarel Fisher
    ------------------------------