mercredi 16 novembre 2016

Robot framework - generate random data

I have a problem with generating the random string in robot. I am very new in robot and really dont know how to figure it out.. I found some solutions here and I tried to follow then, but I am doing something wrong obviously.. I got this error message in console: No keyword with name '${random_string} = Generate Random String' found. My test case:

    *** Settings ***
Library    String
Resource   resource.robot

*** Test Cases ***
Add New Project
    ${random_string} = Generate Random String    12    [LOWER]
    Fill In Project Mandatory Fields    ${random_string}   descriptiondunno
    Verify Added Project
    [Teardown]    Close Browser

In the resource file I have defined the keywords I am using in test:

Fill In Project Mandatory Fields
    [Arguments]  ${random_string}    ${description}
    Wait Until Element Is Visible    ${PROJECT TITLE}
    Input Text    ${PROJECT TITLE}   ${random_string}

and also:

Verify Added Project
    [Arguments]    ${random_string}
    Click Element    ${PROJECTS}
    Table Should Contain    ${GRID}    ${random_string}

I really appreciate any help, because I am really lost in this now :( Thanks!




Aucun commentaire:

Enregistrer un commentaire