Forum Discussion

jonathon's avatar
jonathon
Contributor
4 years ago
Solved

Global input file and variables

Hi   I'm a new ReadyAPI user handling a migration project. Currently the 3-4 examples we've been given had a lot of repetitive data tasks in there. For example each test have the following repeated...
  • richie's avatar
    richie
    4 years ago

    Hi jonathon 

     

    yep = the value you need to specify for the GUID is ${=java.util.UUID.randomUUID()}

     

    so for my payload I have a testcase level property setup on the ehctemplateid attribute in my payload as follows:

     

    {
    "name" : "TestCaseNumber003",
    "ehctemplateid" : "${#TestCase#ehctemplateid}",
    "ehcstatus" : 814250000,
    "ehcversion" : "1.0",
    "countersignature" : false
    }

     

    and I have a testcase property entitled ehctemplateid with a value of ${=java.util.UUID.randomUUID()}

     

    this will dynamically generate the GUID automatically - I just ran the test and the payload in the RAW request is as follows:

     

    {
    "name" : "TestCaseNumber003",
    "ehctemplateid" : "00b188a2-068c-494f-99d1-8faaa7be6303",
    "ehcstatus" : 814250000,
    "ehcversion" : "1.0",
    "countersignature" : false
    }

     

    nice one

     

    rich