Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
3 years ago
Solved

Accessing 'Gherkin' Keywords in the Test Logs (Looking for an urgent advice)

Hi,

I need to access the 'When' in the test logs and add a picture to its 'Has Picture' column. 

The problem is that the picture I need to add will be captured further down in the 'When' statements (check line 6th in the log hierarchy, it captures the picture with Log.Picture) as it captures one of the test steps. Please check the attachment.

So once the picture has been captured in one of the steps, I need to add the picture to the 'When' (which is the second line in the log hierarchy).

This is something important as the reviewer just want to check the picture for the When entry and don't want to go inside to look at each test step.

 

Thanks very much!

 

  • TestQA1's avatar
    TestQA1
    3 years ago

    Thank you for your reply. The picture is captured after performing some steps so logging it after When won't make a difference. I will try to find another solution.

    Can you please also share if we can add some actions/functionality in Feature files' Gherkin keyword Scenario and When, then etc.? Like if I want to add a counter with each Gherkin step that increments with the sequence? Example Test Case 1,2 and so on...

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    There's no way to go back and change a log line once it's been written. The only thing I can suggest is that you try to log the picture earlier, perhaps as the first step after the When.

    • TestQA1's avatar
      TestQA1
      Frequent Contributor

      Thank you for your reply. The picture is captured after performing some steps so logging it after When won't make a difference. I will try to find another solution.

      Can you please also share if we can add some actions/functionality in Feature files' Gherkin keyword Scenario and When, then etc.? Like if I want to add a counter with each Gherkin step that increments with the sequence? Example Test Case 1,2 and so on...

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Please add your new question as a new post on the forum. This makes the question and answer searchable for others looking for answers. Thanks!