go2khurram
9 years agoContributor
Need to insert tomorrow's date in JDBC Request Step in "yyyy-MM-dd'T'HH:mm:ss" format
Hi, I need to insert a row having tomorrow's date as a value of date column by using the JDBC request step. Along with date I am reading some other values from by previous JDBC result. I have man...
- 9 years ago
Thanks for your time.
I am trying to add date but script througs error. here is the code. I am sorry I am very new to Groovy (even in any prog language)
import groovy.time.TimeCategory import com.eviware.soapui.support.XmlHolder use ( TimeCategory ) { def toDate = new Date() def tomDate = new Date() + 1.days def a = toDate.format("yyyy-MM-dd'T'HH:mm:ss") def b = tomDate.format("yyyy-MM-dd'T'HH:mm:ss") log.info a log.info b } testRunner.testCase.setPropertyValue ("Date1" , a) testRunner.testCase.setPropertyValue ("Date2" , b)
- 9 years ago
I manage to save the date now in custome propertied by using below code , now the in the next step I will try to use custome property in SQL Query.
import groovy.time.TimeCategory import com.eviware.soapui.support.XmlHolder use ( TimeCategory ) { def toDate = new Date() def tomDate = new Date() + 1.days def a = toDate.format("yyyy-MM-dd'T'HH:mm:ss") def b = tomDate.format("yyyy-MM-dd'T'HH:mm:ss") testRunner.testCase.setPropertyValue ("CDate" , toDate.format("yyyy-MM-dd'T'HH:mm:ss")) testRunner.testCase.setPropertyValue ("TMDate" , tomDate.format("yyyy-MM-dd'T'HH:mm:ss")) }