Forum Discussion

aadithyaks's avatar
aadithyaks
Occasional Contributor
5 years ago

Java datetime groovy.lang.MissingPropertyException: No such property: executionTime for class: Scrip

I am trying to read current datetime in SOAPUI groovy script class. The code works in CST timezone.

On a different machine in India IST timezone (Java version is matched 1.8) it is giving error

 

ERROR [errorlog] groovy.lang.MissingPropertyException: No such property: executionTime for class: Script1
groovy.lang.MissingPropertyException: No such property: executionTime for class: Script1

 

Here are the code lines

def executionTime = new java.text.SimpleDateFormat("MM-dd-yyyy' 'hh:mm").format(new Date())
groovyUtils.setPropertyValue("Results", "executionTime", executionTime.toString())

 

I have NOT included

import java.util.*;
import java.util.Date;

 

Interestingly 

In another groovy script class this is working.

import java.util.*;
import java.util.Date;

//Set current date and time in 24hr Date Format
def currentDateAndTime = new java.text.SimpleDateFormat("yyyy_MM_dd'_'HH_mm").format(new Date())
testRunner.testCase.setPropertyValue("currDateTime", currentDateAndTime)

 

I am not getting much overlap time to debug, So it is tricky. Appreciate any hint or tips that would resolve the issue.

Kindly request for any more info.

 

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    People try to help in the forums.

    But your request is weird, it is not that you don't know to resolve the problem, but you are not getting time to debug. It means expecting others time to invest for you.

    • aadithyaks's avatar
      aadithyaks
      Occasional Contributor
      Please do not misunderstand.
      I don't know the answer.
      To try each solution I have to work remote on India PC ...
      So, if I get a workable solution...cuts down cycle time
      • nmrao's avatar
        nmrao
        Champion Level 3
        What does it show?

        def executionTime = new java.text.SimpleDateFormat('MM-dd-yyyy hh:mm').format(new Date())
        log.info executionTime