SoapUI: scripting today's date
See Working with Properties and the subsequent articles under that same “Scripting & Properties” section.
SoapUI can do Groovy scripting, and I’ve been using that to get today’s date into some fields that require a date.
e.g.
${=def now = new Date();now.format("yyyy-MM-dd")}
I’d been copying that to each request, which works fine, but is a little longer than I’d like. There’s a way to define project-level variables, that can also use scripting, then reference those from messages. Which makes for at least a slightly smaller field content like this:
<ver:VerificationDate>${#Project#today}</ver:VerificationDate>
Where the ${#Project#variable-name}
is how you reference project-level variables. See Property Expansion
To set up project-level variables (called “properties”), double-click on the project name/folder, then press the plus symbol in the Properties list at the bottom: