How to handle dependencies based on user inputs

Dear Community,

I could use some support on how to best approach this situation:
We have four software packages with a similar structure. The users are prompted to select the packages (1,2,3 or 4) by using the Get Selections From User -option to trigger the check. The steps (keywords) will be the same across packages, but the checks need to adapt based on the selected package.

So for example we have the options for: Word, Excel, Paint & Photoshop and i have defined the login, check and logout in my keywords. How do i need to define my testcases??? IF/Else or TAGs or…

What I have now:

IF any(*'word'* (' in url for url in [${url1}, ${url2}, ${url3}, ${url4}])
    [keyword] login
         + Change the generic/random value to "Word" so we can validate and log that we are checking the right program. *[Get Title       matches     Word]*
    [keyword] do your check
    [keyword] done, please logout
ELSE
    Log  Nothing found
END

(repeat this code for the 4 options)

Thank you in advanced :slight_smile:

Some ways to organize the tests:

  • First test suite get the choice from user, and set env variable APP_UNDER_TEST
  • Second actual test suite call with:
    – robot --include %APP_UNDER_TEST% --variable APP_UNDER_TEST:%APP_UNDER_TEST% TestSuiteFolder
  • Use rebot to produce log/report

Test suites may have dependent resource files named: specific_app_$APP_UNDER_TEST.resource
And you should have a common.resource

The use of IF/ELSE will also exist in the some common keywords.

1 Like