I am testing a Webportal which has a Muti Factor Authentication. And I do not want webdriver to open a new browser everytime a new feature/Test Suite is executed. In order to do this there are only two options:
Retaiin Cookie after first login and use across.
Create a Test Suite Master file like TestNgXml file where you open browser once and run all your test suites.
However I am not able to implement either of them, so I am open for suggestions.
Hi Dave,
Thank you for your response. I do understand Suite setup and teardown, but do we have a keyword to control multiple Test suites , example you create a master robotfile and include all your test suites you want to run inside this main robot file. It is similar of having a XML files in Test NG where you can use include tag and then you define all the different test scripts you want to execute.
I am looking for similar solution because today it is difficult for me to put all my tests in a single Test suite.
I am struggling to create the robot master file. Please have a look into below from TestNG.
In this way you can run/configure multiple suites inside a single file. Is it possible to do same with robotframework? (Not directly in command line or using Tags.)
In robot framework, you can include resource files, which are just robot files without any test cases section.(can be called .resource or .robot it doesn’t matter
You can have “master” robot files that only have test cases and a settings section with a resource line to import the file(s)
You can also have multiple robot files with test cases in a folder or even a folder structure and then tell robot to run all tests in that folder (see Specifying test data to be executed )
Thank you for clarification Dave. Only challenge with this approach is, I still have to write all my tests in a sigle file. I was looking for a solution where I can import tests written in “.robot” files to a single file and not to import them as Resource files.
No with the folder approach you can have a few test cases in each file, just put them all in the same folder and when you run robot, you give the path to the folder instead of the path to a single robot file, then all the .robot files in that folder will be run.
i guess you can say the folder becomes the master test case file and there’s is no special import syntax, just being in the folder means it’s imported - makes it easy to see.
Yes you are right, putting all tests in a folder is a good approach but then the main challenge I have today is that I cannot open Browser once and skip multi factor authentication for other tests.
Another aproach would be that I do not close browser after 1st test suite execution and use “Go to” key word. I am not sure if it is possible to define sequence for test suite, so that the test suite with open browser is executed first.
That’s why I mentioned the __init__.robot file, use a Suite Setup in that file to open the browser and do the MFA and a Suite Teardown in that file to close the browser.
Sure, this sounds like a good approach. Thank you.
I am also really impressed with this community forum; I am getting help even on weekends. Thank you for your support.