jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: cache.html
Date Tue, 02 Mar 2010 01:24:36 GMT
>What would be "good assertions" in this case?
Anything that determines that your page is as it should be. Typically there
is a title/header that is unique to the page (or some combination). May also
be something like  the standard error message shown shouldn't be there. This
is application specific. Anything that gives you reasonable confidence that
the right page was reached.


>Do you know a link that explains how can I extract this string using a
post-processor and regex/xpath extractor?
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Expression_Extractor
http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html
for an example (using google!)
http://cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html

In your case something like
RefName= varCacheUrl
Regex =  wb=['"]([^'"]*)['"]
Template=$1$
MatchNo=1
DEFAULT_VALUE=failed

and in request3 you could use /MainPortal/${varCacheUrl} //same as ref name
defined above
You can also use debug sampler + view results tree listener after request2
so that you can see that your regex ran correctly and extracted the value
into the variable defined by ref name


>Is the post processor a child of the second http request?
Yes it should be a child of the request whose response you want to parse (in
your case)


Testing AJAX apps is a degree more difficult in JMeter family of testing
tools (non browser driven)
regards
deepak

On Mon, Mar 1, 2010 at 5:14 PM, Rodolfo Landa <rodolfo.landa@gmail.com>wrote:

> Hi Deepak,
>
> Thanks for your quick answer.
>
> This is a simple test that opens the main page (mainPortal).  Manually I
> open the portal with a url: http://localhost:8080/mainPortal/ui.html. When
> it opens I can see some Titles, Graphs, Totals, Buttons. What would be
> "good
> assertions" in this case?
>
> BTW, I am not the programmer of this development. I do know my way around
> Java. I research a bit more and this is a GWT development and when I
> recorded the above url I get (among many other things) these 3:
>
> url 1 looks like: /mainPortal/ui.html
> url 2 looks like: /mainPortal/com.mycompnay.swt.mymodule.ui.nocache.js
> url 3 looks like: /mainPortal/B895E5E418BB75D0FA2FC15B392635C3.cache.html
>
> After I added the View Results Tree as you suggested I found that the
> Response Data tab, for the *.nocache.js url, shows a string like this:
> "...wb='B895E5E418BB75D0FA2FC15B392635C3.cache.html'" which is part of the
> url 3.
>
> Do you know a link that explains how can I extract this string using a
> post-processor and regex/xpath extractor?
>
> Is the post processor a child of the second http request?
>
> Thanks,
>
> Rodolfo
>
>
>
> On Mon, Mar 1, 2010 at 3:45 PM, Deepak Shetty <shettyd@gmail.com> wrote:
>
> > >I run the test and everything is alright. No errors on Error % column.
> > Merely means that there are no HTTP errors, not that there are no errors
> ,
> > unless you add good assertions to your test , you cannot rely on this
> > column
> > >1) How do I know which urls not to include in the test plan (*.png,
> *gif.
> > etc).
> > Because you should know what your app does and what is significant to it.
> > In
> > this case one of the previous request (probably the HTML one) should have
> > had the path to this cache file and you should be able to dyanmically
> > extract the name(using regex/xpath extractors) into a variable and use
> the
> > variable in your next request
> > >2) Is this *.cache.html a url that I should include in my test
> > You should know that. if you dont you'll have to ask the developers of
> your
> > app. If in doubt , include it.
> >
> > Add a View Results Tree Listener (or do a view source in the browser) and
> > see which request has the path to your cache file and extract it using a
> > post processor into  a vraible.
> > There should be examples in this mailing archive
> > regards
> > deepak
> >
> >
> > On Mon, Mar 1, 2010 at 3:39 PM, Rodolfo Landa <rodolfo.landa@gmail.com
> > >wrote:
> >
> > > Hi all,
> > >
> > > I recorded a test in my client A against a Server A (This is my
> > "developer"
> > > environment. The HTTP Requests that the Proxy Server returns have paths
> > > like:
> > >     - *.html
> > >     - *.js
> > >    - *.css
> > >    - *.gif
> > >    - *.png
> > >     - *schema
> > >
> > > I deleted all except the ones ended with ".html" and moved them to a
> Plan
> > > that looks like:
> > >
> > >   Test Plan My Test
> > >        Thread Group - Main Page
> > >             HTTP Request - url 1
> > >                  HTTP Header Manager (recorded by Proxy as well)
> > >             HTTP Request - url 2
> > >                  HTTP Header Manager
> > >             Summary Report
> > >
> > > Where:
> > >
> > > url 1 looks like: /mainPortal/ui.html
> > > url2 looks like:
> /mainPortal/B895E5E418BB75D0FA2FC15B392635C3.cache.html
> > >
> > > I run the test and everything is alright. No errors on Error % column.
> > >
> > > I take the Plan to the Client that is going to be used for running
> JMeter
> > > and change the Server Name to the real one (Staging). When I run the
> plan
> > I
> > > get 100% error in the url with *.cache.html.
> > >
> > > If I re-record I noticed that url 1 is the same but url 2 is different
> in
> > > the big number between "/" and .cache.html.
> > >
> > > I have two questions:
> > >
> > > 1) How do I know which urls not to include in the test plan (*.png,
> *gif.
> > > etc).
> > > 2) Is this *.cache.html a url that I should include in my test? If yes:
> > is
> > > there a way to use a variable so the url works in both environments.
> > >
> > > Regards,
> > >
> > > Rodolfo
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message