SOAtest assert on partial date/timestamp

dgoedhdgoedh Posts: 30


I like to assert on a DB value containing a time stamp e.g. 2019-06-13 09:04:23.338024, by only considering the date part 2019-06-13 and neglecting the time.

Can this be accomplished with a build in assertion of SOAtest or should this be implemented with a custom assertion?

Thanks in advance .

Regards ,




  • dgoedhdgoedh Posts: 30

    This worked for me for now in a custom assertion:

    from java.lang import *
    from java.text import *
    from java.util import *
    from soaptest.api import *
    from com.parasoft.api import *

    DATASOURCENAME = "Select_Tabel_DS"

    def compareValue(input, context):
    valueFromDS = context.getValue(DATASOURCENAME,"TS_START")
    subDate = input[0:10]
    #Application.showMessage ("TS_START was: " + input)
    #Application.showMessage ("TS_START wordt: " + subDate)

    if (valueFromDS == subDate):
        return 1
        return 0
Sign In or Register to comment.