jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sobczak <msobc...@yahoo.com>
Subject Re: Accessing prev object as a DOM
Date Wed, 06 Feb 2013 19:33:02 GMT
Sorry, I don't see how the Java API shows how to access SampleResult via JavaScript.

Can you provide an example?




________________________________
 From: sebb <sebbaz@gmail.com>
To: JMeter Users List <user@jmeter.apache.org>; Michael Sobczak <msobczak@yahoo.com>

Sent: Wednesday, February 6, 2013 2:05 PM
Subject: Re: Accessing prev object as a DOM
 
On 6 February 2013 14:45, Michael Sobczak <msobczak@yahoo.com> wrote:
> Hi,
>
> The API documentation states that there is an object called "prev" that I can access
in a BSF Post Processor script.
>
> What I'd like to do is use a BSF Post Processor to create a jMeter parameter based on
the value of a field in the response.  If the field is empty, I need to assign a default
value to the parameter.  If the field is not empty, I can save the field value in the parameter.
>
> I'd like to use JavaScript in my BSF Post Processor.  How do I reference the document
(or DOM) contained within the "prev" object?
>

The prev field is an instance of SampleResult [1] and so you can
access any of its public methods.

However, the Regulal Expression Extractor [2] is likely to be easier to use.
Or perhaps the CSS/JQuery or XPath extractor.

[1] http://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html
[2] http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor
> Thanks,
>
> - Mike.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message