Get tags from the --include and --exclude parameters

58 views
Skip to first unread message

Артур Башлыков

unread,
Mar 1, 2016, 6:22:52 AM3/1/16
to robotframework-users
Is it possible to get tags in the test script from the --include and --exclude parameters?

Hélio Guilherme

unread,
Mar 1, 2016, 12:49:15 PM3/1/16
to robotframework-users


terça-feira, 1 de Março de 2016 às 11:22:52 UTC, Артур Башлыков escreveu:
Is it possible to get tags in the test script from the --include and --exclude parameters?

I don't think that we have access to that info. You may try to do some include/exclude calculations from knowing the current tags and the possible ones.
@{TEST_TAGS} contains current included tags.

But there are these keywords that may interfere with the calculus (unless you do it in the Test Suite Setup):
Set Tags
Remove Tags

Pekka Klärck

unread,
Mar 1, 2016, 1:19:48 PM3/1/16
to Артур Башлыков, robotframework-users
2016-03-01 13:22 GMT+02:00 Артур Башлыков <arthur.b...@gmail.com>:
> Is it possible to get tags in the test script from the --include and
> --exclude parameters?

No, this information isn't easily available. You could try parsing it
from sys.argv or getting it from Robot's internal modules
programmatically. It is probably easier to workaround this, for
example, by setting a separate variable that contains this info:

robot --include foo --exclude bar --variable include:foo
--variable exclude:bar tests.robot

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Reply all
Reply to author
Forward
0 new messages