You need to use combination of the following:
- OS Process Sampler (to spawn your utility JAR)
- Regular Expression Extractor (to get generated URL)
Details:
Given you have java binary in your system path you need the following:
Under Thread Group add an OS Process Sampler
- Set Command to be java (to be completely sure type full path to your java binary, i.e. "d:appsjava6injava.exe")
- Under Command Parameters add following: -jar *your.jar* EACH ON SEPARATE LINE, again it's better to use full path to your jar.
- Add View Results Tree listener at the same level as OS Process Sampler
If you run your Thead Group you should see the following:
System Call Complete.
Process Output:
http://example.com/api?params=....
I believe that you're interested in something, which comes after "params="
So get this value add a Regular Expression Extractor Post Processor as a child of OS Process sampler with following details:
- Reference name - any meaningful name for variable, let it be "params"
- Regular Expression - http://www.example.com/(.*)
- Template - $1$
That will extract api?params=... so you'll be able to use it as path for your HTTP Request as ${params}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…