Data driven testing using excel

Hi Mahesh,

Yes keep all your common keywords and variables in a robot file that has no test cases, then just include it in your robot files that do have test cases, you can see Resource files for details.

Depending on how complex your app is you might want to have multiple robot resource files of keywords grouped by business area or user type, however you want to structure it.

For example: for one app I had

  • appname.robot, this file didn’t have any keywords, variables or test cases, just references to all my resource files (below)
    • appmain.robot, this file had the main url in variables, and keyword for login, logout and top level menu navigation
    • ModuleA.robot, this had all the keywords related to Module A (e.g. this might be your HR module, so keywords relating to submitting timesheets, leave requests etc)
    • ModuleB.robot, pretty sure you can guess

Then in my test case robot files I just add a a reference to appname.robot and all the keywords from the other robot files become available to my test cases.

You can see an example of this here: Create common robot file for generic actions in robot framework - #2 by damies13

You can organise it however you like, but that’s what made sense for me when dealing with a large complex application.

Dave.

1 Like