Use the variable extractor
Based on the two previous examples, this section briefly shows you how, just as for HTML requests, NeoLoad variable extractor mechanism can be used with SOAP requests.
The process is composed of the following steps:
- Extracting into a variable the image identifier, in other words the CaptchaImageGuid, from GetNewWord response
- Re-injecting the value of the variable when invoking the ValidateImageWord request.
- To use the variable extractor
- Extract the image identifier CaptchaImageGuid from GetNewWord response
- Go to the Design section by selecting the Design button.
- Select the Virtual users tab.
- Unfold the appropriate Virtual User node.
- Select the GetNewWord request from which the image identifier value will be extracted.
- Go to the Variable extractors tab.
- Open the Advanced settings dialog box by selecting the Advanced button.
- Select the Variable extractors tab.
- Define a new variable:
- Select the + (plus) button to add a new variable. This opens a Variables Extractor dialog box. In the example you will define the captchaImageGuid variable . The way the value is identified and extracted is quite straightforward since the XML response is simple. You may want to extract anything appearing between the starting <captchaImageGuid> and ending </captchaImageGuid> XML tags.
- At this stage the extraction part of the process is complete. Each time the GetNewWord is invoked NeoLoad will extract the value of the image identifier and set the captchaImageGuid variable with it.
- For more details on extracting variables refer to Create a variable extractor<in_pdf_tuto> and to Variable extractors<in_pdf_design>.
- Re-inject the value into the ValidateImageWord request using a variable:
- Select the ValidateImageWord request in which the image identifier value will be injected.
- Select the Edit XML Content button to configure the XML content.
- Select the XML Tree tab.
- Select the captchaImageGuid element in the XML panel.
- Select the Variable Picker dialog box using the picker button. You can also start typing something like ${c and NeoLoad will suggest variable name completions.
- Choose the captchaImageGuid variable. NeoLoad will extract the image identifier from the GetNewWord response and inject it in the ValidateImageWord request. This sequence can be replayed multiple times.
Home