开发者

jmeter help - test around polling /w meta refresh

开发者 https://www.devze.com 2023-03-18 05:57 出处:网络
I am new to jmeter and am working on putting together a test plan.The hurdle I\'ve encountered is as follows:

I am new to jmeter and am working on putting together a test plan. The hurdle I've encountered is as follows:

First, a POST is made to processForm.aspx

Then, the user is redirected to pleaseWait.aspx

This page either redirects immediately to results.aspx OR loads, with a META REFRESH tag set to refresh in 5 seconds (and this step is repeated).

Now -- I can get this to execute by doing the following:

HTTP Sampler POST to processForm.aspx
  Assert Response contains "<something on pleaseWait.aspx>"
While LAST
  HTTP Sampler GET to pleaseWait.aspx
    Assert Response contains "<something on results.aspx>"

However -- I don't care for this method, because it results in failed assertions (even though things are working as expected). I am sure there must be some other way to do this? Anyone more familiar with JMeter than I?

UPDATE:

Got it going by using Regular 开发者_运维技巧Expression Extractor instead of Assertions.

1) Add a User Defined Variables section at Test Plan Root 2) Add a variable to it "LoginWait" and "false"

HTTP Sampler POST to processForm.aspx
  RegEx Extract Response Body contains "<something on pleaseWait.aspx>" into LoginWait
While ${LoginWait}
  HTTP Sampler GET to pleaseWait.aspx
    RegEx Extract Response Body contains "<something on pleaseWait.aspx>" into LoginWait
...


You could try using "follow redirects" on your HTTP Request. It would eliminate the logic you need, and still get you to the page you're going.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号