gauge-python icon indicating copy to clipboard operation
gauge-python copied to clipboard

Getting error when I provide the table at the scenario & step level

Open balaji2711 opened this issue 2 years ago • 9 comments

Getting error when I provide the table at the scenario & step level

Gauge version: 1.4.3 IDE: VS code

  1. Create a spec file.
  2. Provide the table at the scenario & step level
  3. Observe the spec file.

Actual result: Getting the message as 'Dynamic parameter could not be resolved' and Dynamic parameter could not be resolved. PFA for the screen-shot Expected result: It should not be thrown any error message.

The same works fine when I provide the table at the feature level.

image

balaji2711 avatar Jun 24 '22 08:06 balaji2711

for table driven scenario see https://docs.gauge.org/writing-specifications.html?os=linux&language=javascript&ide=vscode

you need to set allow_scenario_datatable=true in your properties file or via environment vars. Steps can only take table as parameters.

sriv avatar Jun 24 '22 08:06 sriv

Yes. Already I had gone through the gauge documentation and enabled that flag as well in the properties file. Thanks for sharing the information 👍

PFA for the screenshot of a properties file image

balaji2711 avatar Jun 24 '22 09:06 balaji2711

can you share a sample project for us to investigate?

sriv avatar Jun 24 '22 09:06 sriv

I reinstalled the gauge extension in VS code and now I can provide the table at the scenario level not at the step level.

One more issue, have observed in the generated gauge report - The total executed scenarios are 3 and passed are 3 but in the report, passed count shows as 2 -

image

Spec file for your reference -

Login Specification

  • When I navigated to Login Page

Login to the demo application

tags: sanity

  • When I login as "standard_user" using "secret_sauce"
  • Then login should be successful

Login to the demo application with examples

tags: sanity

username password
standard_user secret_sauce
performance_glitch_user secret_sauce
  • When I login as using
  • Then login should be successful

balaji2711 avatar Jun 24 '22 09:06 balaji2711

possibly because of https://github.com/getgauge/gauge/issues/1299

sriv avatar Jun 24 '22 10:06 sriv

Ok, Thanks for the update.

balaji2711 avatar Jun 24 '22 11:06 balaji2711

Hi @sriv, I'm getting an error message when I provide the table at the step level. Already the below flag is enabled in default.properties file -

Enable scenario datatable

allow_scenario_datatable = true

image

balaji2711 avatar Jun 27 '22 10:06 balaji2711

Scenario is the H2 header starting with ##. Scenario datatable has to be under it. You seem to have placed it as a step parameter

sriv avatar Jun 27 '22 13:06 sriv

Ok, Got it, Thanks.

balaji2711 avatar Jun 27 '22 14:06 balaji2711