Service Virtualization

Expand all | Collapse all

doDateDeltaFromCurrent function giving error

Jump to Best Answer
  • 1.  doDateDeltaFromCurrent function giving error

    Posted 11-30-2018 05:13 AM

    Hi ,

     

    Can someone please help me in resolving the error. I am getting error when i am trying to use doDateDeltaFromCurrent function.

     

    {{ =doDateDeltaFromCurrent("yyyy-MM-dd","0D");/2008-12-17}}

    {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss.SSSZ","0D 0H 0M S 0Ms");/*2018-11-30T07:11:35.128Z*/}} 

    {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss.SSSZ","0D 0H 0M 0S 0Ms");/*2018-01-10T07:11:35.128Z*/}}

    {{=doDateDeltaFromCurrent(quot;yyyy-MM-dd HH:mm:ss.SSSquot;,quot;-1D -18H -59M -37S -547Msquot;);/*2018-07-11 19:49:09.892*/}}

     

     

    Error Message :

     

    ERROR com.itko.lisa.test.ParseInState - Could not evaluate expression '=doDateDeltaFromCurrent(quot;yyyy-MM-dd HH:mm:ss.SSSquot;,quot;-1D -18H -59M -37S -547Msquot;);/*2018-07-11 19:49:09.892*/'

    java.lang.IllegalArgumentException: Looking for "," in magic date expression but did not find it. Syntax error

           at com.itko.lisa.test.ParseInState$Hit.doDateDelta(ParseInState.java:520)

           at com.itko.lisa.test.ParseInState$Hit.doDateDeltaCurrent(ParseInState.java:511)

           at com.itko.lisa.test.ParseInState$Hit.evaluate(ParseInState.java:400)

           at com.itko.lisa.test.ParseInState.parseInState(ParseInState.java:279)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1966)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1948)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1944)

           at com.itko.lisa.test.ScriptNode._execute(ScriptNode.java:121)

           at com.itko.lisa.test.ScriptNode.execute(ScriptNode.java:103)

           at com.itko.lisa.test.TestNode.executeNode(TestNode.java:984)

           at com.itko.lisa.test.TestCase.execute(TestCase.java:1297)

           at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)

           at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)

           at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)

           at com.itko.lisa.coordinator.Instance.run(Instance.java:208)

     

     



  • 2.  Re: doDateDeltaFromCurrent function giving error

    Posted 11-30-2018 05:42 AM

    Re. 1st one, has a space in front of '=' and the default date at the end is not correctly defined, try this:

     

    {{=doDateDeltaFromCurrent("yyyy-MM-dd","0D");/*2008-12-17*/}}

     

    Re. 2nd one, I would expect it fails because of the date delta parameter, it is either 'D'ays or 'H'ours or 'M'inutes, or..., try this:

    {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss.SSSZ","0D");/*2018-11-30T07:11:35.128Z*/}} 

     

    Re. 3rd one, don't use the " when you are editing this in a  WYSIWIG editor, this is similar to 2nd one.

     

    Re. 4th one, here the "quot"s are not correctly formatted, this is similar to 2nd one.

     

    Cheers,

    Danny



  • 3.  Re: doDateDeltaFromCurrent function giving error

    Posted 11-30-2018 06:15 AM

    Hi DannySaro

     

    Thanks for the quick response.

    When i tried to use the second one  as suggested by you - i am getting the below error.

     

    {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss.SSSZ","0D");/*2018-11-30T07:11:35.128Z*/}} 

     

    Error Message:

    2018-11-30 11:09:26,556Z (22:09) [VS24_SGB_IIB [VS_VS24_SGB_IIB_Run]/1] ERROR com.itko.lisa.test.ParseInState - Could not evaluate expression '=doDateDeltaFromCurrent(quot;yyyy-MM-dd HH:mm:ss.SSSquot;,quot;-1D -18H -59M -37S -547Msquot;);/*2018-07-11 19:49:09.892*/'

    java.lang.IllegalArgumentException: Looking for "," in magic date expression but did not find it. Syntax error

           at com.itko.lisa.test.ParseInState$Hit.doDateDelta(ParseInState.java:520)

           at com.itko.lisa.test.ParseInState$Hit.doDateDeltaCurrent(ParseInState.java:511)

           at com.itko.lisa.test.ParseInState$Hit.evaluate(ParseInState.java:400)

           at com.itko.lisa.test.ParseInState.parseInState(ParseInState.java:279)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1966)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1948)

           at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1944)

           at com.itko.lisa.test.ScriptNode._execute(ScriptNode.java:121)

           at com.itko.lisa.test.ScriptNode.execute(ScriptNode.java:103)

           at com.itko.lisa.test.TestNode.executeNode(TestNode.java:984)

           at com.itko.lisa.test.TestCase.execute(TestCase.java:1297)

           at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)

           at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)

           at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)

           at com.itko.lisa.coordinator.Instance.run(Instance.java:208)



  • 4.  Re: doDateDeltaFromCurrent function giving error
    Best Answer

    Posted 11-30-2018 06:41 AM

    This is not the error message for the expression that you posted??? You can see that from the date default value in the stack trace /*2018-07-11 19:49:09.892*/

    So, we can't say anything sensible about this error message, can you provide an expression and an error message that is synchronized?

     

    Cheers,

    Danny



  • 5.  Re: doDateDeltaFromCurrent function giving error

    Posted 11-30-2018 06:43 AM

    It worked now. Thank You.