Forum Discussion

cpentecost's avatar
cpentecost
Occasional Contributor
5 years ago
Solved

How to add Groovy Scripts to data source

Hello Community   I am trying to add a script that will allow me to choose tomorrow's date into a data source property in SoapUI pro. The Call fails if we use a date int he past but we don't want ...
  • jsheph01's avatar
    5 years ago

    You can place this in a properties step or use it in a request. It will return tomorrows date in YYYY-MM-dd HH:mm format. 

    ${=import java.text.SimpleDateFormat ; new SimpleDateFormat("YYYY-MM-dd HH:mm").format(new Date()+1)}

    If you would like to use a different date format this doc should be helpful.

    https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html