[Questions] Certificate level II (Non-developer background)

Hi everyone,

I have been walking through the Certificate level II as a Non-developer background, Kindly advise me to get through these 2 issues (for now) :

  1. I cannot “Input Text” in Legs: even though I know that id="1648988153450"

  2. I am wondering if “RPA.Tables” is the correct library to manage the csv file

Huge thanks.

Kindly have my codes below:

*** Settings ***
Documentation     Order robots from RobotSpareBin Industries Inc.
...               Saves the order HTML receipt as a PDF file.
...               Saves the screenshots of the ordered robot.
...               Embeds the screenshots of the robot to the PDF receipt.
...               Creates ZIP archive of the receipt and the images.
Library           RPA.RobotLogListener
Library           RPA.Browser.Selenium    auto_close=${False}
Library           RPA.HTTP
Library           RPA.Tables

*** Tasks ***
Order robots from RobotSpareBin Industries Inc
    Open the robot order website
    Download the CSV file
    Close the annoying modal
    Fill the form
    #    Preview the robot
    #    Submit the order
    #    ${pdf}=    Store the receipt as a PDF file    ${row}[Order number]
    #    ${screenshot}=    Take a screenshot of the robot    ${row}[Order number]
    #    Embed the screenshots of the robot to the PDF receipt    ${screenshot}    ${pdf}
    #    Go to order anoter robot
    #
    # Create a ZIP file of the receipts

*** Keywords ***
Open the robot order website
    Open Available Browser    https://robotsparebinindustries.com/#/robot-order

Download the CSV file
    Download    https://robotsparebinindustries.com/orders.csv    overwrite=TRUE

Close the annoying modal
    Click Button    css:button[class="btn btn-dark"]

Fill the form # Currently, I am using the hard code technique first, and planing to move to "Read from CSV file" technique.
    Select From List By Value    head    1
    Select Radio Button    body    2
    Input Password    1648988153450     3
    Input Text    address    Address 123
    Click Button    Preview
    #[Arguments]    ${orders}
    #Select From List By Value    Order number    ${orders}[Order number]
    #Input Text    Head    ${orders}[Head]
    #Select Radio Button    Body    ${orders}[Body]
    #Input Text    Legs    ${orders}[Legs]
    #Input Text    Address    ${orders}[Address]
    #Click Button    Submit
    #Fill the form using the data from the csv file
    #Files to Table    orders.csv
    #${orders}=    Get orders    header=True
    #FOR    ${row}    IN    @{orders}
    #Fill and Submit the form for one order    ${orders}
    #END

Hi Nattawut,

Welcome to the Robocorp Community. :pray:
The point of this certificate is to help you to improve your skills, so I’ll not solve your issue for you, but I can give you some hints, so you can figure it out by yourself.

  1. For your first question, there is a trick… If you check again the ID… HHHOOO it has changed…
    In fact, on the robotSpareBin the id is changing every time and as far as I know, there is no way to predict which id will be used.
    So the question is, should you really use the id to trigger the Legs field?

  2. Yes RPA.Tables can manage CSV files

From the documentation:

It can import data from various sources and apply different operations to it. Common use-cases are reading and writing CSV files, inspecting files in directories, or running tasks using existing Excel data.

Best regards,
Gael

1 Like

Hi Gael,

I truly appreciate your advice. After I got your advice I have a look at RPA.Browser.Selenium ( Locating elements) with Explicit locator strategy Using xPath, it works now.

I am in middle of moving forward.

Thank you so much.

Regards,
Nattawut.

1 Like

I’m glad to hear that.

1 Like

Hi Gael,

I need to bother you more (Kindly accept my apology in advance).

For your information, I already passed to manual submit process with hardcode technique.

Currently, I have changed to use variable and loop technique but I am struck in the middle.

Could you please advise

*** Settings ***
Documentation     Order robots from RobotSpareBin Industries Inc.
...               Saves the order HTML receipt as a PDF file.
...               Saves the screenshots of the ordered robot.
...               Embeds the screenshots of the robot to the PDF receipt.
...               Creates ZIP archive of the receipt and the images.
Library           RPA.RobotLogListener
Library           RPA.Browser.Selenium    auto_close=${False}
Library           RPA.HTTP
Library           RPA.Tables
Library           RPA.PDF

*** Variables ***
${orders}=        Get orders    ${row}[Order number]
${pdf}=           Store the receipt as a PDF file    ${row}[Order number]
${screenshot}=    Take a screenshot of the robot    ${row}[Order number]

*** Tasks ***
Order robots from RobotSpareBin Industries Inc
    Open the robot order website
    Download the CSV file
    Close the annoying modal
    Loop Over A List Of Items And Log Each Of Them
    Fill and Submit the form
    Preview the robot
    Submit the order
    Loop Over A List Of Items And Log Each Of Them

*** Keywords ***
Open the robot order website
    Open Available Browser    https://robotsparebinindustries.com/#/robot-order

Download the CSV file
    Download    https://robotsparebinindustries.com/orders.csv    overwrite=TRUE

Close the annoying modal
    Click Button    css:button[class="btn btn-dark"]

Loop Over A List Of Items And Log Each Of Them
    FOR    ${row}    IN    @{orders}
        Log    ${row}
    END

Fill and Submit the form
    Select From List By Value    head    1
    Select Radio Button    body    2
    Input Text    xpath:/html/body/div/div/div[1]/div/div[1]/form/div[3]/input    3
    Input Text    address    Address 123

Preview the robot
    Click Button    Preview

Submit the order
    Click Button    order
    Wait Until Keyword Succeeds    1 min    1 sec    Click Button    order

Can you please describe what problem do you have?

Although I already have a little idea. But when it comes to troubleshooting, it really helps to lay down what happens to try to explain in great detail to another person what the problem is.

Hi Gael,

Thank you for your advice. Currently, my obstacle for now is:

How my robot can read the csv file, and do looping by filling information in the website automatically. Therefore, I use the code as below :

Loop Over A List Of Items And Log Each Of Them
    FOR    ${row}    IN    @{orders}
        Log    ${row}
    END

However, my robot doesnot understand it yet. At this stage, I am also confused if I do it correctly by adding “*** Variables ***” here

*** Variables ***
${orders}=        Get orders    ${row}[Order number]

Please be noted that I did hardcord for 1 entry with this code before but it works properly.

Fill and Submit the form
    Select From List By Value    head    1
    Select Radio Button    body    2
    Input Text    xpath:/html/body/div/div/div[1]/div/div[1]/form/div[3]/input    3
    Input Text    address    Address 123

Preview the robot
    Click Button    Preview

Submit the order
    Click Button    order
    Wait Until Keyword Succeeds    1 min    1 sec    Click Button    order

Once I can go through this stage, It will be “15. Store the order receipt as a PDF file” and so on.

Kindly advice.

Thank you so much for your advice. :wink:

Hi! This topic is discussed in the Beginners’ course. It is best to complete that course first before tackling the harder one. :slight_smile:

1 Like

Thank you for your advice, Jani.

I got the RPA certification level I: Beginner’s course already.

Could you please advise how could I tackle the current issue.

Here is my current code:

*** Settings ***
Documentation     Order robots from RobotSpareBin Industries Inc.
...               Saves the order HTML receipt as a PDF file.
...               Saves the screenshots of the ordered robot.
...               Embeds the screenshots of the robot to the PDF receipt.
...               Creates ZIP archive of the receipt and the images.
Library           RPA.RobotLogListener
Library           RPA.Browser.Selenium    auto_close=${False}
Library           RPA.HTTP
Library           RPA.Tables
Library           RPA.PDF

*** Tasks ***
Order robots from RobotSpareBin Industries Inc
    Open the robot order website
    Download the CSV file
    Close the annoying modal
    Fill and Submit the form
    Preview the robot
    Submit the order
    Loop Over A List Of Items And Log Each Of Them

*** Keywords ***
Open the robot order website
    Open Available Browser    https://robotsparebinindustries.com/#/robot-order

Download the CSV file
    Download    https://robotsparebinindustries.com/orders.csv    overwrite=TRUE

Close the annoying modal
    Click Button    css:button[class="btn btn-dark"]

Fill The Forms
    ${orders}=    Get orders
    FOR    ${row}    IN    @{orders}
        Fill And Submit The Form    ${row}
    END

Get orders
    Read csv file
    ${csv}=    Read table from CSV    orders.csv    header=True
    [Return]    ${csv}
    Close CSV file

Fill and Submit the form
    Select From List By Value    //*[@id="head"]    ${row}[Head]
    Select Radio Button    body    ${row}[Body]
    Input Text    xpath:/html/body/div/div/div[1]/div/div[1]/form/div[3]/input    ${row}[Legs]
    Input Text    address    Address    ${row}[Address]

Preview the robot
    Click Button    Preview

Submit the order
    Click Button    order
    Wait Until Keyword Succeeds    1 min    1 sec    Click Button    order

Not sure what your current issue is, but if you look at the tasks.robot file in VS Code, it will display (red underlining) several issues in the code (missing keywords and undefined arguments).

It might be good to revisit the beginners’ course and study the sections where custom (user) keywords and their arguments are discussed.

There’s also a section dedicated to Robot Framework syntax and concepts. That might be useful to go through.

The Robot Framework cheat sheet and quick reference is useful after you have a good grasp of the concepts and need a quick refresher of how to do something.

There are plenty of example robots in the portal that might give some inspiration.

Noted with Huge thanks.

I will go through them as per your advice.

Regards,
Nattawut

Just to clarify here you need to use the full XPath as the XPath itself still contains the variable ID :

XPath:
//*[@id=“1680218865150”]

Full XPath:
/html/body/div/div/div[1]/div/div[1]/form/div[3]/input