You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Remedy QA <re...@yahoo.com> on 2004/06/08 02:15:21 UTC

RE: Embedded JavaScript files are being parsed as HTML

I tried with the nightly jakarta-jmeter-20 build and this problem is not there anymore. However with the nightly jakarta-jmeter build, this problem is still apparent for me.
I did submit a bug on the release 2.0, which first exhibited the problem.

"BAZLEY, Sebastian" <se...@atosorigin.com> wrote:
Can you create a Bugzilla issue please?

A while ago we did quite a bit of work on fixing the link parsing, and we
created some test files to check that the parsing worked.

If there are other examples of HTML that are not being parsed correctly, it
would be useful to have them added as attachments to the Bugzilla issue.

The current test files are in bin/testfiles.

A new parser can be added, but you will need to write a JMeter "wrapper" to
call the relevant parser code using its particular API.

This should be fairly easy - have a look at one of the existing wrappers.

S.
-----Original Message-----
From: Remedy QA [mailto:remedyqa@yahoo.com]
Sent: 27 May 2004 17:56
To: JMeter Users List
Subject: RE: Embedded JavaScript files are being parsed as HTML


Eric, I have the same problem. However, using the RegexpHTMLParser doesn't
solve my problem. My Javascript has a sample code of the following:

newCalDoc.write("
PCGetDefaultCSSStylesheet() + "' type=text/css rel=stylesheet>\n");

And when running the test, it is trying to retrieve
GET http://localhost/arsys/apps/shared/javascript/" +
PCGetDefaultCSSStylesheet() + "

Using JTidyHTMLParser only follows css embedded links in html but doesn't
even recognize embedding javascript files. It basically ignores and does not
retrieve the Javascript files, which isn't what I want. I want it to
retrieve Javascript files but not parse them.

Would it be possible to add other HTML parser jar files? Can we simply drop
it in the lib directory and reference it in jmeter.properties?

thanks,
mabel
"Mcintyre, Eric" wrote:
The RegexpHTMLParser seems to do the trick. Thanks!

-----Original Message-----
From: BAZLEY, Sebastian [mailto:sebastian.bazley@atosorigin.com]
Sent: Thursday, May 27, 2004 8:24 AM
To: 'JMeter Users List'
Subject: RE: Embedded JavaScript files are being parsed as HTML


First try using a different Parser - see htmlParser.className in
jmeter.properties - as one of the others may be better at handling the
context in which 
is recognised.

The regex parser is fast, but does not take much notice of context.

The classnames are shown in the property file, if you want to look at the
code

S.
-----Original Message-----
From: Mcintyre, Eric [mailto:Eric.Mcintyre@tenethealth.com]
Sent: 27 May 2004 15:16
To: JMeter User Mailing List (E-mail)
Subject: Embedded JavaScript files are being parsed as HTML


Hello,

I am running an HTTP test script, where I have the HTTP Samplers loading
embedded resources. On some pages, one of the linked JavaScript files has a
function to output an HTML page. It appears that JMeter is parsing this code
as if it is HTML and following the embedded "links". The offending
JavaScript looks like this:

function writePleaseWaitMessage(doc, nextUrl)
{
doc.open();
doc.writeln("");
doc.writeln("");
doc.writeln("");
doc.writeln("
href=\"/styles/RedFlagStyles.css\">");
doc.writeln("
href=\"/styles/tenetstyles.css\">");
doc.writeln("");
doc.writeln("onLoad=\"javascript:window.location='", nextUrl, "'\">");
// ... and so on
}

The rather strange result in JMeter (Results Tree) is:
+- Root
|- /jsp/logon.jsp
|- (other links from /jsp/logon.jsp)
+- http://localhost/javascript/redflag.js
(200)
| |- http://localhost/javascript/redflag.js
(200)
| +- http://localhost/javascript/\->http://localhost/javascript/\/
(404)
| |- http://localhost/javascript/\
(302)
| |- http://localhost/javascript/\/
(404)
|- (more links from /jsp/logon.jsp)

When I remove the lines in the JS function that output 
tags,
everything works as expected. Apparently the HTML parsing code sees "href=\"
and tries to follow it. The correct behavior, though, would be for the
parser to ignore it, since the resource has a MIME type of
application/x-javascript. Is this a known issue, or should I create a
Bugzilla report? Also, if someone can point me to a likely place in the
code, I'll investigate it and try to fix it.

Thanks,
Eric


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


___________________________________________________________________________

This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail in
error, please notify the sender immediately and destroy it. As its integrity
cannot be secured on the Internet, the Atos Origin group liability cannot be
triggered for the message content. Although the sender endeavours to
maintain
a computer virus-free network, the sender does not warrant that this
transmission is virus-free and will not be liable for any damages resulting
from any virus transmitted. 
___________________________________________________________________________


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




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


---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

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

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger