1

Our team wants to migrate the tests from QTP. We have the automation flows for UI, API and some database tests. After a long research, I found robotframework would be a nice tool.However as I started writing tests, I found that I am writing tests and corresponding keywords for test case in single file.

As the number of test cases increase, it seems I cannot maintain all of the code in one file. I would like to separate the tests and keywords in to different files. Is there a way we can do it? If it is, please provide some examples on usage.

2 Answers 2

2

The most common and the most logical way to partition your tests is to organize them as per their testing areas.

You can refer to this link for more details. Robot Framework doc

0

You should definitely separate your keywords from your tests and can use resource files to do so. A good practice is to have a page object file that holds all the keywords for interacting directly with the page. The page elements should be in variables and this file is where all the selenium keywords should be. This way, if the UI changes, you only have to change this file and not each and every test. The actual tests should read as plainly as possible so that non technical folks can clearly understand them. Typically, don't use Selenium keywords here. This will also make the results file much easier to read.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.