Search code examples
javatestingautomated-testsbddgetgauge

Dynamic parameter cannot be resolved in Gauge


i try to use the file special parameter in a Gauge specification.

Export a customer
----------------------------------------
* Find customer "Hans"
* Export customer to <file:/customer.xml>

The java implementation for this looks like this

@Step("Export customer to <file>")
public void test(String file) {
   System.out.println("file " + file);
}

I assume the parameter typ is String (can it also be File ?)

But nevertheless, running this, returns

[ParseError] C:\Users\user\IdeaProjects\qmsgauge\specs\tenantManagement.spec:40 
 Dynamic parameter <file:/customer.xml> could not be resolved => 'Export customer to <file:/customers.xml>'
Successfully generated html-report to => C:\Users\user\IdeaProjects\qmsgauge\reports\html-report\index.html

How do I define the file parameter in the spec and how do need to write the java implementation for this ?

Thanks


Solution

  • Path starting with "/" assumes that it is the root. If a relative path is used do not start with "/"

    so the parameter value can be - file:specs/example.spec