Forum Discussion

mkhan031486's avatar
mkhan031486
Contributor
7 years ago
Solved

Displaying last 3 digits of a order number

Hi, I'm trying to test a test case where I have to pass the last three digits of an order number that I have created from another groovy script.    Below is my original script that creates the orde...
  • nmrao's avatar
    nmrao
    7 years ago

    Not sure why are you using like that while it can be done easily by:

     

    Note that if you need to use that extracted value in a request, no addition groovy script is required. Instead use in-line script in the request itself as shown below:

     

    <id>${=  def id = testRunner.testCase.getPropertyValue("OrderNumber"); id.substring(5, id.size())}</id>