Skip to main content

Store Target and Post-Processing

You

can

The use the Store tab in the scenarioScenario editorEditor allows you to define extractors that can "listen"listen for a particularspecific Step and Request and extract data offrom its response.

When creating a Store entry or an Assert entry in the Scenario Editor, you need tomust configure the Target dependingaccording onto the type and format of the response.

Also,You youcan might require toalso apply some post-processing to the response.extracted Invalue. thisPost-processing document,allows you willto findtransform, encode, decode, or otherwise manipulate the value before it is stored or used by the scenario.

This document provides examples of the possible values that can be used for the Target and thePost-processing fields.

Post-Processing

Post-processing inputs.functions operate on the value extracted by the Target.

PostProcessingThe value() function represents the value extracted by the configured Target.

Here is a list of examples of all the possible functions that can be used for post-processing entry.

value() returns the extracted value.Examples:

    substring(value(), 0, 2)

    — returns a substring of the extracted value.URLEncode(value()) — URL-encodes the extracted value.URLDecode(value())

    substring(URLEncode(— URL-decodes the extracted value.

    append(value(), 2)

    URLEncode(value())

    URLDecode(value())

    append(value(),"-abc123")

    — appends the specified string to the extracted value.

    length(value())

    — returns the length of the extracted value.

    URLParam(value(), 'id')

    — extracts the specified URL parameter from the value.

    Target

    The Target field supports different syntaxes depending on the type of response being processed.

    InThe the same way, the TARGET can have aTarget hint text thatin shouldthe beScenario dynamicEditor can change dynamically according to the selected Target.target type.

    The // characters indicate a comment and are not part of the target,Target withsyntax, theexcept exceptionfor HTML Targets, where // is part of the HTMLXPath target that is an XPath.expression.

    DEFAULT

    Default Targets

    The following Targets can be used with any supported response:

    • duration
    • duration //— returns the request duration

      duration.
    • responseCode — returns the HTTP response status code.
    • size
    • responseCode //— returns the response status code

    size // returns de size in bytesbytes.

    md5 — returns the MD5 checksum of the responseresponse.

    HTTP Targets

    For example, given the following response:

    data=45, data=68

    md5You //can use:

    • raw/data[0] — returns checksumdata=45.
    • raw/data[1] md4— returns data=68.
    • #data — returns 45.
    • Header:Accept — returns the value of the responseAccept header.
    • CookieValue:CSRF-TOKEN

    HTTP Targets

    Given the response is the following string: "data=45, data=68" then

      raw/data[0] //— returns 'data=45' and "raw/data[1]" returns 'data=68'

      #data // returns 45

      Header:Accept // returns dethe value of the header Accept

      CookieValue:CSRF-TOKEN // returns de value of the cookie CSRF-TOKEN

      cookie.

      HTML Targets

      Use normalstandard XPathsXPath expressions to extract values from HTML.HTML Noteresponses.

      that

      For inHTML this caseTargets, the double slash// at the beginning is needed inof the target.Target is part of the XPath and is required.

      Example:

        //input[@name='__RequestVerificationToken']/@value

        This Target returns the value of the value attribute of the matching input element.

        JSON Targets

        Use JSON paths to extract values from JSON responses, likeresponses.

        For example, given a JSON response containing an employees array:

        • employees[0].address.city
            — returns the city of the first employee.

          [2].carousel.images[1].path

          — returns the path value of the second image in the carousel of the third element.

          PDF Targets

          The following Targets can be used to extract information from PDF responses:

          • document
          • —

            document // getsreturns all text in documentthe exceptdocument, formsexcluding text

            form text.

          page[2] //— returns alall text infrom page 22, exceptexcluding formsform text

          text.documentforms —

          documentforms // getsreturns a jsonJSON with contentsrepresentation of the forms contained in the document

          document.

          regex:Once upon a .* ever after. //— returns the text that matchesmatching the specified regular expressionexpression, if found.

          STRING

          String Targets

          String Targets can be used to extract a portion of a response based on delimiters or positions.

          GivenFor example, given the following response:

          The tested process returned: ID=ABCDEF.

          Examples:

          • 11,20 — returns processed.
          • ID=,false — returns ABCDEF.
          • ID=,true — returns ID=ABCDEF.
          • ID=,38,false — returns the portion of the response isaccording to the followingspecified string:delimiter "Theand testedposition.
          • ID=38,true processed returned: ID=ABCDEF." then
            • 11,20" //— returns "processed"the portion of the response according to the specified position and inclusion option.

            Note: The exact behavior of positional String Targets depends on the Target syntax supported by the current AIQ version.

            Text

            Targets

            ID=,falseFor //text returnsresponses, "ABCDEF."

            specify the

            ID=,true // returns "ID=ABCDEF."

            ID=,38,false // returns "ABCDE"

            ID=38,true // returns "ID=ABCDE"

            TEXT Targets

            The target should be specifiedTarget as a regular expression,expression.

            like:

            Examples:

              (?<=\\"__RequestVerificationToken\\" type=\\"hidden\\" value=\\")[a-zA-Z0-9\\-_]+

              id=.*

              The Target returns the text matching the specified regular expression.

              CSV Targets

              GivenCSV thatTargets allow you haveto aextract responsevalues from responses formatted as aCSV.

              CSV

              For withexample, given the following dataCSV data:

              id 

              name 

              state

              1 

              john 

              California

              2 

              barry 

              Nevada

              3 

              stef 

              Texas

              4 

              karla 

              New York

              Then:Examples:

                2,2 //— returns barry

                .

                last(),"name" //— returns karla

                .

                ,"name" //— returns a stringan array {"name"containing name,"john" john,"barry" barry,"stef" stef,"karla"}

                and karla.

                3,last() //— returns Texas

                .

                id=3,2 2 //— returns stef

                .

                Note: Make sure the indexing behavior used by CSV Targets matches the indexing convention of your AIQ version.


                Last updated: FebruaryAugust 22,12 20232026

                If you have any feedback onabout this topic, please contact us at documentation@appvance.ai.