On 22/11/05, Baumgartner, Christian <[EMAIL PROTECTED]> wrote:
> i want to write out those links, that doesn't belong to specific pool of 
> given links.
>
> the pool contains the following links (by example):
> http://jamaica.at/test1.htm
> http://jamaica.at/servlet34/contextlayout,5/
> http://jamaica.at/guide/home.htm
> AND
> http://jamaica.at/article(N).htm        (where N = a number between 0 and 
> 1000, some ID of course)
>
> beside this links, it is in some cases possible, that there are other links 
> too. and for these other links i want JMeter to  call an Error.
>
> other link example:
> http://jamaica.at/home.html
> http://jamaica.at/servletcontainer/index/snoop
 ...
>
> What I do:
> I parse the Hyperlinks of a given Page,
> then I proove if the link is one of the pool,
> IF NOT i call a HTTP Sample with some wrong parameter, so it get marked red 
> in a listener.
>
> So I get all the foreign links of the page, that shouldn't appear there.
>
> But the Problem is http://jamaica.at/article(N).htm this kind of link. I want 
> to proove this too, but not with a simple IF condition because I just know 
> the structure of the link, but not what all links will look like in 
> production area.
>
> So I thought of the combination Regular Expression Extractor and IF 
> CONTROLLER. But it doesn't work some way like this:
> IF CONTROLLER( "${parsedLink}"=="/article\d+\.htm" )
>
>
> Any other way to go?

Assertions are normally the way to detect errors.

I don't think it's at all easy to use the normal Response Assertion,
because you want to match part of the response but then reject some of
the matches, and the RA always applies the expression to the whole
response.

So I agree that you need to extract the links first, and then find a
way of detecting the invalid ones.

I think there are a few ways you can do this:

- use the links extracted by the Regex Extractor in a For Each
controller. This can be passed to a BeanShell Sampler that can check
the links against the list and return a suitable status. This would
generate one response for each link, whether valid or not.

- Instead of the Foreach Controller, use a BeanShell Assertion or a
BeanShell Sampler, and use it to loop through all the variables. If no
bad links are found, return true, otherwise false. The Assertion would
not generate any more responses; the Sampler one more response.

Does that make sense?

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to