You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bennett McElwee <Be...@telecom.co.nz> on 2006/05/31 00:19:44 UTC

Embedded resources in WML pages

The HTML samplers can automatically retrieve embedded images from web
pages, but it doesn't work for all XHTML pages or WML pages. I thought
I'd warn users about this, and bounce my solution off you good people.

JMeter determines whether a file is HTML by checking that its media type
is text/html. If it's something else, for example application/xhtml+xml,
application/xml, text/xml or text/vnd.wap.wml, then it won't try to
parse the file to retrieve embedded resources. So if you're trying to
test a WAP or XHTML application, JMeter may not be able to do what you
want.

As far as I can tell, this could be fixed most simply by changing
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase as follows:

1. In downloadPageResources(), "text/html" is hardcoded. Either read a
list of allowed media types from properties, or hardcode a list of media
types. Maybe just allow any media type that contains "html" or "wml".

2. If parsing a WML page, ignore the configured parser and use
RegexpHTMLParser. (I guess the other parsers won't handle WML.)

Could some knowledgeable person confirm that this should work? If so, I
will hunt down a JDK and try to make it happen. If I can find time I
will try to submit a patch, but don't hold your breath...

Thanks,
Bennett.
--
Bennett McElwee

This communication, including any attachments, is confidential. If you are not the intended recipient, you should not read it - please contact me immediately, destroy it, and do not copy or use any part of this communication or disclose anything about it. Thank you. Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Embedded resources in WML pages

Posted by sebb <se...@gmail.com>.
On 04/06/06, sebb <se...@gmail.com> wrote:
> On 30/05/06, Bennett McElwee <Be...@telecom.co.nz> wrote:
> > The HTML samplers can automatically retrieve embedded images from web
> > pages, but it doesn't work for all XHTML pages or WML pages. I thought
> > I'd warn users about this, and bounce my solution off you good people.
> >
> > JMeter determines whether a file is HTML by checking that its media type
> > is text/html. If it's something else, for example application/xhtml+xml,
> > application/xml, text/xml or text/vnd.wap.wml, then it won't try to
> > parse the file to retrieve embedded resources. So if you're trying to
> > test a WAP or XHTML application, JMeter may not be able to do what you
> > want.
> >
> > As far as I can tell, this could be fixed most simply by changing
> > org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase as follows:
> >
> > 1. In downloadPageResources(), "text/html" is hardcoded. Either read a
> > list of allowed media types from properties, or hardcode a list of media
> > types. Maybe just allow any media type that contains "html" or "wml".
>
> Sounds like a good idea.
> Perhaps you could create a Bugzilla enhancement for this?
>
> > 2. If parsing a WML page, ignore the configured parser and use
> > RegexpHTMLParser. (I guess the other parsers won't handle WML.)
>
> Not sure about parsing WML pages - they seem to be rather different
> from (X)HTML.
>
> But it should not be too difficult to specify a different parser for
> certain types of content - we could just add a  wmlParser.classname
> property alongside the htmlParser.classname.
>
> Perhaps we could also add:
>
> htmlParser.mimetypes
> wmlParser.mimetypes
>
> to specify the MIME media types that JMeter can handle, as well as
> which is HTML and which is WML?
>
> > Could some knowledgeable person confirm that this should work? If so, I
> > will hunt down a JDK and try to make it happen. If I can find time I
> > will try to submit a patch, but don't hold your breath...
>
> A Bugzilla enhancement would be useful...
>

Actually, don't bother creating a Bugzilla request...

It was easy enough to add the code, so please just check out the
nightly build 2-1.20060604 instead, and see if it works for you.

Configuration details are in jmeter.properties.

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Embedded resources in WML pages

Posted by sebb <se...@gmail.com>.
On 30/05/06, Bennett McElwee <Be...@telecom.co.nz> wrote:
> The HTML samplers can automatically retrieve embedded images from web
> pages, but it doesn't work for all XHTML pages or WML pages. I thought
> I'd warn users about this, and bounce my solution off you good people.
>
> JMeter determines whether a file is HTML by checking that its media type
> is text/html. If it's something else, for example application/xhtml+xml,
> application/xml, text/xml or text/vnd.wap.wml, then it won't try to
> parse the file to retrieve embedded resources. So if you're trying to
> test a WAP or XHTML application, JMeter may not be able to do what you
> want.
>
> As far as I can tell, this could be fixed most simply by changing
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase as follows:
>
> 1. In downloadPageResources(), "text/html" is hardcoded. Either read a
> list of allowed media types from properties, or hardcode a list of media
> types. Maybe just allow any media type that contains "html" or "wml".

Sounds like a good idea.
Perhaps you could create a Bugzilla enhancement for this?

> 2. If parsing a WML page, ignore the configured parser and use
> RegexpHTMLParser. (I guess the other parsers won't handle WML.)

Not sure about parsing WML pages - they seem to be rather different
from (X)HTML.

But it should not be too difficult to specify a different parser for
certain types of content - we could just add a  wmlParser.classname
property alongside the htmlParser.classname.

Perhaps we could also add:

htmlParser.mimetypes
wmlParser.mimetypes

to specify the MIME media types that JMeter can handle, as well as
which is HTML and which is WML?

> Could some knowledgeable person confirm that this should work? If so, I
> will hunt down a JDK and try to make it happen. If I can find time I
> will try to submit a patch, but don't hold your breath...

A Bugzilla enhancement would be useful...

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org