Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Link Parser seems not work properly. #1040

Closed
asfimport opened this issue Feb 20, 2003 · 6 comments
Closed

HTML Link Parser seems not work properly. #1040

asfimport opened this issue Feb 20, 2003 · 6 comments

Comments

@asfimport
Copy link
Collaborator

Paulo Gustavo Veiga (Bug 17252):
Hi, all,

I’m trying to develop a Test in which one request need parameters form the
previous one.
I developed similar tests using the Jmeter 1.7.2 using the HTML Link Parser
modifier.

Now, I’m trying to develop a similar test using the JMeter 1.8.1 and the
parameters that I want to replace are not found.

This is the response page from the previous requests. I could not find if the
problem is in the response. However, this problem happened also with other
pages.

In this case the “pepe” parameter is not found:

HTTP/1.1 200 OK
Server: Resin/2.1.3
Cache-Control: private
Set-Cookie: FUEGO_PARTICIPANT_ID=paulo; Path=/portal4.5; Expires=Thu, 27-Feb-
2003 17:49:06 GMT
Set-Cookie: FUEGO_PARTICIPANT_AUTOLOGIN=null; Path=/portal4.5; Expires=Thu, 01-
Dec-1994 16:00:00 GMT
Set-Cookie: FUEGO_PARTICIPANT_PASSWORD=null; Path=/portal4.5; Expires=Thu, 01-
Dec-1994 16:00:00 GMT
Set-Cookie: JSESSIONID=arC41PKJPBSg; Path=/
Content-Type: text/html
Content-Length: 539
Date: Thu, 20 Feb 2003 17:49:06 GMT

<html>

<head>
<title>Fuego - Work Portal</title>

</head>

<body onLoad="checkBrowserSupport()">

<form method="post" action="pepe?miParam=true" name="useragentinfoform">

&lt;input type="hidden" name="useragentinfo" value="true"&gt;
&lt;input type="hidden" name="useragentinfojavapluginenabled" value="cure"&gt;
&lt;input type="hidden" name="useragentinfotimezone" value=""&gt;
&lt;input type="hidden" name="pepe" value="123123"&gt;


&lt;input type="hidden" name="submitbutton" value="Login"&gt;

</form>

</body>
</html>

Do anybody want the process to check this ?

Thanks all for your time.
Paulo

Votes in Bugzilla: 1
OS: other

@asfimport
Copy link
Collaborator Author

Paulo Gustavo Veiga (migrated from Bugzilla):
I found the problem. :)

The problem is that I can’t get parameters from a html form that has a action
attribute URL distinct to the URL path of the request in witch want to replace
it.

Here an example:

If the response from a http request is the following:

<html>
<head></head>
<body>
<form action=”servlet/myJsp” >
<input type=”hidden” name=”miParam” value=”someValue”>
</form>
</body>
</html>

And the next request that contains that HTTP Link Parser has the following
URL path: /portal4.5/servlet.
I this context, the ‘HTTP Link Parser’ does not get ‘miParam’ hidden parameter.

You should take into account that I could change the form action using Java
Script and the problem will be the same.

If you want to hear some suggestion, I recommend don’t do this type of check.
What do you think? .

Best Regards.
Paulo

@asfimport
Copy link
Collaborator Author

Mike Stover (migrated from Bugzilla):
I'm not sure what to do with this. Would it be a good idea for the link parser
to ignore the path element of a link? Should it check that only the arguments
match? Any comments from anyone?

@asfimport
Copy link
Collaborator Author

Paulo Gustavo Veiga (migrated from Bugzilla):
I have been thinking in one solution. I suggest only matching with the form
action without the query string. This is to solve the problem that I explain
previously.

This solution brings us a new problem. Which of the selected form does the
JMeter select?. The current implementation is select one in a random mode.
This almost always is not the expected behavior. I think that the JMeter user
should have the ability to select one of them.

In a typical test you know what will be the returned response. Then, you
should have the ability to select one of all the returned forms

Do I have been clear with my solution?

Thank for your help.

@asfimport
Copy link
Collaborator Author

Anthony Whalley (migrated from Bugzilla):
OK I am using v 1.9.1 from source and and for me the HTML Link Parser is
still not working properly.

I have just received a legacy app where the developer is posting forms
and the form also sends a querystring up to the server.
i.e.
<form action="dosummat.asp?aqry=1" action="POST">
<input type="text" value="aval" name="txt1"/>
<input type="submit" />
</form>

My dosummat.asp page needs both aqry and aval and aqry is a key 
generated by the database 
(Bloody ASP developers eh ;-)) 
 
I am using Java 1.4.2 and I have modified HtmlParser.java  
so the calls to the setPath method on the 
HttpSampler url object to simply accept parsedUrlString. 
 
e.g. url.setPath(parsedUrlString) ; 

This gives me the functionality I require. 

However another bug has appeared here. 
The final else that uses 
the Url object does not convert my regex of .* to my former path. 
so the above form fails with 
	 
	http://10.0.0.1/.* 
 
but the form below form will work. 

	&lt;form action="/dosummat.asp?aqry=1" action="POST"&gt; 
		&lt;input type="text" value="aval" name="txt1"/&gt; 
		&lt;input type="submit" /&gt; 
	&lt;/form&gt; 
 
 
I have made all the mods to get this as I want it but it is not  
integrated into the GUI as an option. 
IE change the radio buttons GET or POST to checkboxes GET and POST. 

Should I leave it there or does somebody want to see the code.

Regs

Anton

@asfimport
Copy link
Collaborator Author

Craig Palmer (migrated from Bugzilla):
I hit this exact problem as well (should have checked the bug list before
diagnosing it myself). But to add an extra dimension, things get worse when
dealing with https - maybe this is a different issue. However, the getProtocol()
is failing for me because the config protocol assumes http. In the web page, the
link is relative.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
No more development on a feature that will be probably deprecated in a future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant