Concordion > Commands > "execute" >

Access to a Link's HREF

It is sometimes useful to put test data into a separate file (e.g. a CSV file). You can use the magic variable "#HREF" to let your fixture code know the URL of an anchor.

Note, however, that having separate test data tends to be a "bad smell" suggesting that your test is too implementation-specific and/or covers too many things.

Example

The following instrumentation:

<a href="blah.csv" concordion:execute="#x = myMethod(#HREF)">test file</a>

<span concordion:assertEquals="#x">blah.csv</span>

Will execute myMethod() in the Java fixture code and pass in the parameter "blah.csv" as #HREF. If myMethod() simply returns the value it receives, then the assertEquals should succeed.