https://issues.apache.org/bugzilla/show_bug.cgi?id=54447

            Bug ID: 54447
           Summary: It should be possible to use variable replacement in
                    XPathExtractor XPath definition
           Product: JMeter
           Version: 2.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified

Created attachment 29862
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29862&action=edit
Patch to enable the described functionality

The use case is the following:

Testing a typical eShop solution with the following steps:
1. load the main page
2. Select the browse product catalog link
3. select a random product from the product list
4. Open the selected product detail page

The third step could be defined in JMeter using a Random Variable from 1 to N
and using the XPathExtractor Post Processor for example with the following
XPath
"//div[@class="product" and position()=${selectedProductNum}]/a/@href"
The ${selectedProductNum} varibale is the random generated number and should be
replaced in the XPath.

For me in the specified version it was not working by default.
I created a simple patch which modifies the
"components/org/apache/jmeter/extractor/XPathExtractor.java". I rebuilt the
2.9-SNAPSHOT version from SVN and it is working for me. 

Please consider to apply this patch for the current version if you found it
useful.

Best regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to