Forum Discussion

Christoph_Schwa's avatar
Christoph_Schwa
Contributor
18 years ago

set a date from a testcase property

hi,

i have a testcase where i have a date field where i always want to have the actual date from today and not a fixed date from the datepicker. so i did a simple groovy script to generate todays date, store it as a testsuite property and would like to import that testsuite property into the date field.
but whenever i close the request and reopen it i have the date in there and not the property value anymore.

is there a way to keep the property value?

thanks,
Christoph

8 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Chris,

    hmm.. what exactly are you entering into the field that gets replaced with the actual date?

    regards,

    /Ole
    eviware.com
  • Hi Ole,

    i want to do something like this request from a database:

       
         
             
             
               
                AnyUser
               
                Module
               
                IContract
               
                Login
               
                2008-06-10T00:00:00.000+02:00
               
                2008-06-12T00:00:00.000+02:00
             


    where i would like to replace the Date in 2008-06-10T00:00:00.000+02:00 with a date from a property: ${#TestSuite#TodaysDate} (currently set to Wed Jun 11 16:39:07 CEST 2008)

    so the createdFrom should look like this: ${#TestSuite#TodaysDate}

    thanks,
    Chris
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    ok.. and you're saying that when you enter this property-expansion in the form field, it gets expanded/removed when you open/close the request? Which version/build are you running?

    regards!

    /Ole
    eviware.com
  • Hi,

    yes, i try to select it on the form and it is displayed, but when i switch to the xml then there the date is still shown and when i switch back to the form the date there is shown again.

    i originally created the request in the service with a date set, then copied it to a testcase and wanted to select the property extension.

    i tried to enter it manually in the xml and this works.

    i am using version 2.0.2

    regards,
    Chris
  • Marcel_Brökel's avatar
    Marcel_Brökel
    Occasional Contributor
    i got the same problem. Maybe the date format fields are not accesable with properties ?

    have you tried to paste the propertyextension directly into the xml ?
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi everyone!

    this is fixed in next release, sorry for the inconvenience..

    regards!

    /Ole
    eviware.com
  • Hi,

    for me it works when i manually copy the property string in the XML like this: ${#TestSuite#TodaysDate}

    regards
    Chris
  • mkp's avatar
    mkp
    Occasional Contributor
    I have looked into your problem as you told in the thread that as u close the request and reopen it you are having the date alone in there and not the property value anymore. In my opinion it will work if you manually copy the property string in the XML. So try it and reply whether it solved or not. This technique worked fine for me. Hope it will help you too in retaining the property value. It will be easier as omatzura will fix this problem in the next release.