0

This was a popular question, just curious whether any one found a solution for this.

I referred below links and couldn't find any real answer.

Use of Scenario outline in passing the scenario name as example

How can i get cucumber scenario variables in title?

Scenario outline with examples in title #267

My scenario is looks like below:

Scenario Outline: User login to <Scenario>

    Given the user "<User>" log in
    When user call "<URL>"
    Then the response should return the status code as "400" with error elements:
      | code                           | Message                         |
      | Profile Error                  | Incorrect user user entitlement |                                                

    Examples:
      | Scenario  | User       | URL           | 
      | Domain A  | TestUser1  | user/profile1 | 
      | Domain B  | TestUser2  | user/profile1 | 

In the report I expect three separate results with corresponding scenario name from the Example data, but scenario name coming as empty in higher level in the report and the test result details level ONLY the first scenario name was showing which is Domain A. Not sure whether this is serenity reporting issue

User login to ""

    Given the user "{User}" log in
    When user call "{URL}"
    Then the response should return the status code as "400" with error elements:
.
.
.
.
Marit
  • 2,399
  • 18
  • 27
Shabar
  • 2,617
  • 11
  • 57
  • 98
  • 1
    This feature already exists. If your scenario outline has then it will get replaced by Examples datatable iteration values. Please check if you’re using latest version of io.cucumber. Or please elaborate your question. – Bhuvanesh Mani Mar 03 '20 at 09:22
  • @BhuvaneshMani I added sample scenario to the question. I am using `io.cucumber:cucumber-core:2.4`. But in the report (`serenity`) I cannot see scenarios separately based on the scenario name. – Shabar Mar 03 '20 at 21:32
  • Bhuvanesh's answer works on the cucumber java 7.13.0. – SHI Zhong Ping Jul 20 '23 at 08:39

0 Answers0