Dynamic CucumberOptions Tags

When executing BDD, I need to pick scenarios according according to attributes like

  • environment (some test cases only work in a particular env)
  • network (some only work from intra, others only from internet)
  • smoke or full regression set.
    As above can change at any time due to new requirements, I am using tags to assign the attributes.

However, if I want to use the tags, I need to be using the CucumberRunner and in my understanding need as many Runner classes as there are combinations of my attributes (as tags are passed in into Cucumber.class by way of annotation).
I’d rather want to define all required tags in respective profile (e.g. in a global variable) and then use that to dynamically execute the same Runner class with appropriate tags.
For maintanance I would then only need to change the ‘speaking’ profile.

profile A - @env1 and @internet and @smoke - executes scenarios with those tags
profile B - @env2 and @intranet and @full_regression and not @something - executes scenarios with those tags

Is that possible in Katalon Studio? If not, what could be alternatives to ensure run configuration can be in one place (vs. different profiles calling different runners) or at least most comfortable?
In generic Selenium/Cucumber I guess it would probably work along the lines of Selenium/CustomCucumber.java at master · abcautomate/Selenium · GitHub

Thanks for your help!

This might be of interest to you:

1 Like

It very much is! Thanks @sander.schutten.

What a relief to see that the concept I was after was not some individual phantasy. :dizzy_face:

The code also includes some smooth reporting integration, that is so much better than the acrobatics I had to implement, due to missing hints/documentation on this.

I hope this finds its way into the official product as it’s hard for me to believe any serious BDD implementation can do without, really.

Hi Mateusz,

I’ve created a PR for the Katalon team. Hopefully this PR will be completed so this support will become available in Katalon without having to resort to a custom Keyword.

greetings, Sander


Thank you for the PR. We will take a look and merge the change in upcoming releases.

Please see new keywords:

1 Like