You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jian Tong <To...@Toronto.CBC.CA> on 2007/02/04 23:30:00 UTC

Questions about http post request

Hi,

I have been trying to simulate http post requests with Jmeter. But I cannot understand the results I got. My test plan is like this:

Test Plan
-Thread Group
--http default request
  server: www.qa.nm.cbc.ca
--http request
  path: testthenation/language/pretest/answers
  method: post
  files with the request: .../data1.xml
--view result tree

This xml file contains some data that the server will read and insert into database.

Before I tried with Jmeter, I use Curl to do the post request with the same server name, path and xml file. All data are successfully picked and saved into the database. But when I tried it with Jmeter, no data go to database. The following info is given by "View Results Tree" listener:

(1) view results tree - Sampler result
Thread Name: Thread Group 1-1
Sample Start: Sun Feb 04 12:46:58 EST 2007
Load time: 190
HTTP response code: 200
HTTP response message: OK

HTTP response headers:
HTTP/1.1 200 OK
Date: Sun, 04 Feb 2007 17:46:54 GMT
Server: Apache/1.3.29 (Linux/SUSE) PHP/4.3.4 mod_gzip/1.3.26.1a mod_jk/1.2.6-dev
Set-Cookie: Webtrends=1.130.12.83.260741170611214457; path=/; expires=Fri, 03-Aug-07 17:46:54 GMT
Cache-Control: public, max-age=0
Expires: Sun, 04 Feb 2007 17:46:54 GMT
Connection: close
Content-Type: text/plain

(2) view results tree - Request
POST http://www.qa.nm.cbc.ca/testthenation/language/pretest/answers
POST data:
[no cookies]
Request Headers:
User-Agent: IE/6.0

(3) view results tree - Response data
4

There is on error according to the listener, but I have doubts on two points, one is the post data showing above is empty, so I am wondering if the xml file is really recieved by server. Second is the response data, which is "4".

Anybody can help me to find out what the problem is ?

Thank you


------------------------------------------
Jian Tong - QA 
Production and Operations, CBC.ca
Extension:  3357
Location:    2C300-N
-------------------------------------------

Re: Questions about http post request

Posted by Jian Tong <To...@Toronto.CBC.CA>.
Hi Sebb,

Thanks for your email. I have logged all repsonse into a xml file but there is no error still. And I have tried an invalid path for the xml file on purpose and found that Jmeter complain about this issue. So I think if there is no complain it will mean that Jmeter is able to find the file. 

By the way, do you have any examples for post response (.jmx file) that I can take a look and give it a shot ? 

Thank you very much 

------------------------------------------
Jian Tong - QA 
Production and Operations, CBC.ca
Extension:  3357
Location:    2C300-N
-------------------------------------------

>>> sebb <se...@gmail.com> 02/04/07 5:53 PM >>>

On 4 Feb 2007 17:30:00 -0500, Jian Tong <To...@toronto.cbc.ca> wrote:
>
> Hi,
>
> I have been trying to simulate http post requests with Jmeter. But I cannot
> understand the results I got. My test plan is like this:
>
> Test Plan
> -Thread Group
> --http default request
>   server: www.qa.nm.cbc.ca
> --http request
>   path: testthenation/language/pretest/answers
>   method: post
>   files with the request: .../data1.xml
> --view result tree

Looks OK.

> This xml file contains some data that the server will read and insert into
> database.
>
> Before I tried with Jmeter, I use Curl to do the post request with the same
> server name, path and xml file. All data are successfully picked and saved
> into the database. But when I tried it with Jmeter, no data go to database.
> The following info is given by "View Results Tree" listener:
>
> (1) view results tree - Sampler result
> Thread Name: Thread Group 1-1
> Sample Start: Sun Feb 04 12:46:58 EST 2007
> Load time: 190
> HTTP response code: 200
> HTTP response message: OK
>
> HTTP response headers:
> HTTP/1.1 200 OK
> Date: Sun, 04 Feb 2007 17:46:54 GMT
> Server: Apache/1.3.29 (Linux/SUSE) PHP/4.3.4 mod_gzip/1.3.26.1a
> mod_jk/1.2.6-dev
> Set-Cookie: Webtrends=1.130.12.83.260741170611214457; path=/; expires=Fri,
> 03-Aug-07 17:46:54 GMT
> Cache-Control: public, max-age=0
> Expires: Sun, 04 Feb 2007 17:46:54 GMT
> Connection: close
> Content-Type: text/plain
>
> (2) view results tree - Request
> POST
> http://www.qa.nm.cbc.ca/testthenation/language/pretest/answers
> POST data:
> [no cookies]
> Request Headers:
> User-Agent: IE/6.0
> (3) view results tree - Response data
> 4

Rather  odd.

> There is on error according to the listener, but I have doubts on two
> points, one is the post data showing above is empty, so I am wondering if
> the xml file is really recieved by server. Second is the response data,
> which is "4".
>
> Anybody can help me to find out what the problem is ?
>

Any errors in jmeter.log ? Perhaps the xml file could not be found?

You could add a "Save Responses to a File" Post-Processor - this will
store the exact responses from the server in case the Tree View is not
displaying things correctly.

Or you can use a proxy server or network sniffer to see what is happening.

See

http://wiki.apache.org/jakarta-jmeter/NetworkSniffer

for some suggestions.

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

Re: Questions about http post request

Posted by sebb <se...@gmail.com>.
On 4 Feb 2007 17:30:00 -0500, Jian Tong <To...@toronto.cbc.ca> wrote:
>
> Hi,
>
> I have been trying to simulate http post requests with Jmeter. But I cannot
> understand the results I got. My test plan is like this:
>
> Test Plan
> -Thread Group
> --http default request
>   server: www.qa.nm.cbc.ca
> --http request
>   path: testthenation/language/pretest/answers
>   method: post
>   files with the request: .../data1.xml
> --view result tree

Looks OK.

> This xml file contains some data that the server will read and insert into
> database.
>
> Before I tried with Jmeter, I use Curl to do the post request with the same
> server name, path and xml file. All data are successfully picked and saved
> into the database. But when I tried it with Jmeter, no data go to database.
> The following info is given by "View Results Tree" listener:
>
> (1) view results tree - Sampler result
> Thread Name: Thread Group 1-1
> Sample Start: Sun Feb 04 12:46:58 EST 2007
> Load time: 190
> HTTP response code: 200
> HTTP response message: OK
>
> HTTP response headers:
> HTTP/1.1 200 OK
> Date: Sun, 04 Feb 2007 17:46:54 GMT
> Server: Apache/1.3.29 (Linux/SUSE) PHP/4.3.4 mod_gzip/1.3.26.1a
> mod_jk/1.2.6-dev
> Set-Cookie: Webtrends=1.130.12.83.260741170611214457; path=/; expires=Fri,
> 03-Aug-07 17:46:54 GMT
> Cache-Control: public, max-age=0
> Expires: Sun, 04 Feb 2007 17:46:54 GMT
> Connection: close
> Content-Type: text/plain
>
> (2) view results tree - Request
> POST
> http://www.qa.nm.cbc.ca/testthenation/language/pretest/answers
> POST data:
> [no cookies]
> Request Headers:
> User-Agent: IE/6.0
> (3) view results tree - Response data
> 4

Rather  odd.

> There is on error according to the listener, but I have doubts on two
> points, one is the post data showing above is empty, so I am wondering if
> the xml file is really recieved by server. Second is the response data,
> which is "4".
>
> Anybody can help me to find out what the problem is ?
>

Any errors in jmeter.log ? Perhaps the xml file could not be found?

You could add a "Save Responses to a File" Post-Processor - this will
store the exact responses from the server in case the Tree View is not
displaying things correctly.

Or you can use a proxy server or network sniffer to see what is happening.

See

http://wiki.apache.org/jakarta-jmeter/NetworkSniffer

for some suggestions.

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