Forum Discussion

clickit74's avatar
clickit74
New Contributor
10 years ago

Automtic Manipulation of Test Data

I was able to create several test steps in my testsuite but for each test, the application request has a application number that has to change for each request sent to a corresponding database. I know how to run the entire suite of test cases. I need to understand if it's possible or not to use some type of script to change the application number for each request sent without manually having to do so.

2 Replies

  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi,

    I assume this applicationNumber is a header in your webservices.
    If so, just put this script into your applicationNumber parameter:

    ${= org.apache.commons.lang.RandomStringUtils.random(9, true, true)}


    Here is a link to this class, so you can modify input parameters based on your requirements:
    https://commons.apache.org/proper/commo ... Utils.html

    Regards,
    Marek
  • clickit74's avatar
    clickit74
    New Contributor
    Hi Marek,

    Thanks for the response. It's application number is sitting in a xml request. It looks like the following:

    ApplicationNumber="66344000"

    followed by other elements in the XML request.

    I'll take a look at the link you sent and see if I can apply it to what I'm trying to accomplish.

    Thanks!