Forum Discussion
Hi,
So in terms of why that first snippet deosn't work, what you were missing is that I said to run it from a Groovy script, not a script Assertion, they provide different variables to the script - see the comparison below:
Whereas, the Script Assertion is not run in the context of a test runner hence no testRunner variable (it gets messageExchange instead):
Ok, I think the problem here might be that the syntax for inserting the result of script type expressions is not the same as that for the property expansion syntax that is applied to properties of different scopes - consider the following example:
${=java.util.UUID.randomUUID()}
(also taken from that tricks and tips page, but basically this syntax allows execution of one or more lines of code, can provide more complicated examples if necessary)
Is this what you wanted?
Hope this helps,
Cheers,
Rupert
> Is this what you wanted?
Not quite yet. I would like to find a way to include placeholders representing default properties of test-suite and test-case into the expected content, i.e. into the string that one puts into the "Content"-field of a "Contains Assertion".
Right now, I know how to include project properties there, e.g. using:
some text ${#Project#foobar} some more text
But that only works with Custom Properties! What do I have to write to e.g. include the name of the TestCase (i.e. the value of the "Name" property from the TestCase's "TestCase Properties"-tab) into that field?
Hope, I could make myself clear...