Basically exactly what the title says. I have a datasheet in excel that I am using to run my test cases. Right now it runs every case but I want to limit it to run specific ones. Datadriver says it has tag functionality but when I add it and try running with “-i sometag” it says that tag does not exist.
Has anyone else run into this issue? Seems like it should be possible im just not sure how to get my robot script to see those tags.
So right now when i run the test in my report I can see that it sees the tags. If i run the test with include=foo up where I declare my datadriver library it only runs tests with the foo tag which is great but do you know if there is a way to be able to in my command line add -i foo and have it run just the foo tests?
Right now it says that foo isnt a tag. As far as my robot script would be concerned there is just one test case but datadriver runs all 8 of them. At the beginning of my testcase I have [Tags] FLAT.
Sorry if this response doesn’t make much sense have only been using this framework for a week.
So just realized that my [Tags] flat is doing absolutely nothing from what i can tell. I was just looking through the examples from the datadriver github and gave it a shot. Otherwise this is the important bits of my code
Library DataDriver Datasheet/W2_Datasheet_End_To_End.xls sheet_name=W2_Outsourcing
*** Test Cases ***
Test Case
*** Keywords ***
Test case
[Arguments] ${Scenario} ${json_fileName} ${registeredFiling_Count} ${expectedStatusArrayRcdCount} ${SUBDIR} ${companionFileNamePrefix}
[Tags] foo
foo should run 2 tests as 2 of them have that tag and when at the top i have include = foo it works fine but if i run it with --include foo it says nothing has that tag.
It’s hard to say I guess. In my personal use cases I would want both tags declared in the .robot file and the ones in the excel sheet to work. I think both serve a purpose depending on the use case.
If tags in the excel sheet don’t work then there is no point having them as a feature but also people should have the option of declaring the tags as normal.
That’s my perspective on the question posed in the GitHub link
I am missing something here and I don’t know what is wrong. I hope somebody can help
I need to include and excluse tests using tags defined in the csv file
I have a csv file with Tags and a robot file (see below)and when I run the tests
when I run the test as below everything is fine python -m robot --report NONE --outputdir output --logtitle "Task log" --exclude 1 DataDriven.robot
But when I run the test as below I get an error python -m robot --report NONE --outputdir output --logtitle "Task log" --include 1 DataDriven.robot [ ERROR ] Suite ‘DataDriven’ contains no tests matching tag ‘1’.
But when I run the test as below I get an error python -m robot --report NONE --outputdir output --logtitle "Task log" --exclude 1 --include foo DataDriven.robot
[ ERROR ] Suite ‘DataDriven’ contains no tests matching tag ‘foo’ and not matching tag ‘1’.
I have following files:
DataDriven.csv
*** Test Cases ***;${username};${password};[Tags];[Documentation]
Right user empty pass;demo;${EMPTY};1;This is a test case documentation of the first one.
Right user wrong pass;demo;FooBar;2,3,foo;This test case has the Tags 2,3 and foo
empty user right pw;${EMPTY};mode;1,2,3,4;This test case has a generated name based on template name.
empty user empty pw;${EMPTY};${EMPTY};;
empty user foobar pw;${EMPTY};FooBar;;
foobar user mode pw;FooBar;mode;foo,1;
foobar user empty pw;FooBar;${EMPTY};foo;
foobar user foobar pw;FooBar;FooBar;foo,2;