Hi @nanicoderrf, I’m also having similar situation. Following is what I’m working on:
For ex.: I have the following scenarios
Test Suite #1
Test #1 with template(Data Driver)
Test #2 without template
Test #3 without template
Test Suite #2
Test #1 without template
Test #2 without template
Test #3 with template(Data Driver)
The tests in the suite needs to run in the order. When I import DataDriver library, the other test cases doesn’t run. When I comment out the DataDriver import statement, the templated test doesn’t run. I couldn’t figure it out.
Create a directory for Test Suite #1, create one file for the test with template and a second file for the tests without template, and then run the Suite directory. Do the same for Test Suite #2.
To have less files you could combine Test 2 and 3 into the same file, so you’d only need 2 files for this example.
I remember reading somewhere when using the Data Driver template you couldn’t have the tests without template in the same file (I’m not an expert on this so don’t remember the details)
If you refer to Test templates there are 2 ways to do test templates
the method you’re probably using for Data Driver:
*** Settings ***
Test Template Example keyword
applying a template to a test:
*** Test Cases ***
Normal test case
Example keyword first argument second argument
Templated test case
[Template] Example keyword
first argument second argument
I’m not sure if this second method works with Data Driver, if you can get that working with Data Driver then you might be able to put all test cases in the same file.
Hi Dave,
I did try both ways and none of them work when I add standard tests with templated tests. I’ll test with suite directories and see how it goes. Also, with the suite folder, how can I set the order of tests?
I can’t find it in the documentation, I think the order the tests are executed in is as they are found or processed by robot framework. So I would expect that if you prefixed the files with a number/letter then you should be able to control the order the files get processed.
The only thing I found in the documentation is Randomizing execution order which is probably the opposite of what you want.
*** Test Cases ***
Different argument names
[Template] The result of ${foo} should be ${bar}
1 + 1 2
1 + 2 3
Only some arguments
[Template] The result of ${calculation} should be 3
1 + 2
4 - 1
New arguments
[Template] The ${meaning} of ${life} should be 42
result 21 * 2