A question about HTTP Sampler & Regular Expression Extractor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

A question about HTTP Sampler & Regular Expression Extractor

广东设计院谭伟基
Hello,Everyone!


I find the/Regular Expression Extractor /can't Extract form the
subrequest of the subrequest. it just can Extract form the subrequest of
the main request.
For example,   there's a scenario like this:
1. I input the address in the browser,and press the Enter.
browser -----> (main Request1) -----> server
browser <----- (response1)< -----server (response1 contains two embaded
web page  stored in the server.)
browser -----> (sub-Request2) -----> server        (browser sent the
sub-response2 & sub-response3 Automatically Parallelly)
browser -----> (sub-Request3) -----> server
browser <----- (sub-response2)< -----server
browser <----- (sub-response3)< -----server (sub-response3 contains two
embaded web page  stored in the server.)
browser -----> (sub-sub-Request4) -----> server  (browser sent the
sub-sub-Request4 & sub-sub-Request5 Automatically Parallelly)
browser -----> (sub-sub-Request5) -----> server
browser <----- (sub-sub-response4)< -----server (sub-sub-response4
contains a user session)
browser <----- (sub-sub-response5)< -----server

2.I use /HTTP(S) Test Script Recorder/ to record The whole process
above, then
     a. I set /"Retrieve All Embedded Resources from HTML Files" /&
/"Use concurrent pool/" in the main Request1 to be true,and disable all
the  subrequest ,so the sub-request will be sent Automatically *Parallelly*
     b.I put a /Regular Expression Extractor/ into main Request1 to get
the user session, and set "/Apply to:/"Attribute to be /Main sample and
sub-samples/,but *user session can't be Extracted.*
     c.if I disable /"Retrieve All Embedded Resources from HTML Files"
/& /"Use concurrent pool"/ in the main Request1 ,and enable all the 
subrequest,move the /Regular Expression Extractor/ into sub-Request3,
*user session can be Extracted*.but the sub-request will be sent*in
sequence.*

So,What can I do to satify two demands below?
1. the sub-request will be sent Parallelly
2.user session can be Extracted

Thanks!

--
Wicky Tam

广东省电信规划设计院有限公司
Mobile: 13928535226
eMail:  [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A question about HTTP Sampler & Regular Expression Extractor

Felix Schumacher

Am 04.03.20 um 07:33 schrieb 广东设计院谭伟基:

> Hello,Everyone!
>
>
> I find the/Regular Expression Extractor /can't Extract form the
> subrequest of the subrequest. it just can Extract form the subrequest
> of the main request.
> For example,   there's a scenario like this:
> 1. I input the address in the browser,and press the Enter.
> browser -----> (main Request1) -----> server
> browser <----- (response1)< -----server (response1 contains two
> embaded web page  stored in the server.)
> browser -----> (sub-Request2) -----> server        (browser sent the
> sub-response2 & sub-response3 Automatically Parallelly)
> browser -----> (sub-Request3) -----> server
> browser <----- (sub-response2)< -----server
> browser <----- (sub-response3)< -----server (sub-response3 contains
> two embaded web page  stored in the server.)
> browser -----> (sub-sub-Request4) -----> server  (browser sent the
> sub-sub-Request4 & sub-sub-Request5 Automatically Parallelly)
> browser -----> (sub-sub-Request5) -----> server
> browser <----- (sub-sub-response4)< -----server (sub-sub-response4
> contains a user session)
> browser <----- (sub-sub-response5)< -----server
>
> 2.I use /HTTP(S) Test Script Recorder/ to record The whole process
> above, then
>     a. I set /"Retrieve All Embedded Resources from HTML Files" /&
> /"Use concurrent pool/" in the main Request1 to be true,and disable
> all the  subrequest ,so the sub-request will be sent Automatically
> *Parallelly*
>     b.I put a /Regular Expression Extractor/ into main Request1 to get
> the user session, and set "/Apply to:/"Attribute to be /Main sample
> and sub-samples/,but *user session can't be Extracted.*
>     c.if I disable /"Retrieve All Embedded Resources from HTML Files"
> /& /"Use concurrent pool"/ in the main Request1 ,and enable all the 
> subrequest,move the /Regular Expression Extractor/ into sub-Request3,
> *user session can be Extracted*.but the sub-request will be sent*in
> sequence.*


Where is your session attribute embedded? I tried to extract a header
element -- as I assume that is where the session would be -- and could
get the value with "Apply to:" set to "Main sample and sub-samples" and
"Field to check" set to "Response Headers".

You might even get the session header from the HeaderManager, which
might be easier than deciding which of the headers is the correct one to
chose from.

Felix

>
> So,What can I do to satify two demands below?
> 1. the sub-request will be sent Parallelly
> 2.user session can be Extracted
>
> Thanks!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A question about HTTP Sampler & Regular Expression Extractor

广东设计院谭伟基
Hi,Felix Schumacher:

Glad to receive your response,thanks!

"user session" is in the body of sub-sub-response4,just like this:

Line-based text data: text/html (40 lines)
     <!DOCTYPE html\n
     \tPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n
     \t "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n
     <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">\n
     <head>\n
     <title>Web Tours Navigation Bar</title>\n
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n
     </head>\n
     <body bgcolor="#E0E7F1">\n
        .....
     <form method="post" action="/cgi-bin/login.pl" target="body">\n
    <input type="hidden" name="userSession"
value="128211.168084245zfQtizVpQfiDDDDDDQfzQpVHVHf"/>\n
     <table border="0"><tr><td>&nbsp;</td>\n
        .....

now, I try to use a Parallel controller which can be select from Plugins Manager to Meet my requirements:
1. disable "the Retrieve All Embedded Resources from HTML Files" in the main request.
2. add sub-Request2 & sub-response3 into a Parallel controller next to main request.
3. enable "the Retrieve All Embedded Resources from HTML Files" & "Use concurrent pool" in the sub-response3.
4. put a /Regular Expression Extractor/ into sub-response3 to get user session, and set "/Apply to:/"Attribute to be /Main sample
and sub-samples/.
I'm doing the test to check is it a solution to my question.

but,there is a limit to the solution:Parallel controller maybe do not supported to be put under another Parallel controller. it can't do anything if string is in the response of sub-sub-sub-request.



在 2020/3/6 上午5:21, Felix Schumacher 写道:

> Am 04.03.20 um 07:33 schrieb 广东设计院谭伟基:
>> Hello,Everyone!
>>
>>
>> I find the/Regular Expression Extractor /can't Extract form the
>> subrequest of the subrequest. it just can Extract form the subrequest
>> of the main request.
>> For example,   there's a scenario like this:
>> 1. I input the address in the browser,and press the Enter.
>> browser -----> (main Request1) -----> server
>> browser <----- (response1)< -----server (response1 contains two
>> embaded web page  stored in the server.)
>> browser -----> (sub-Request2) -----> server        (browser sent the
>> sub-response2 & sub-response3 Automatically Parallelly)
>> browser -----> (sub-Request3) -----> server
>> browser <----- (sub-response2)< -----server
>> browser <----- (sub-response3)< -----server (sub-response3 contains
>> two embaded web page  stored in the server.)
>> browser -----> (sub-sub-Request4) -----> server  (browser sent the
>> sub-sub-Request4 & sub-sub-Request5 Automatically Parallelly)
>> browser -----> (sub-sub-Request5) -----> server
>> browser <----- (sub-sub-response4)< -----server (sub-sub-response4
>> contains a user session)
>> browser <----- (sub-sub-response5)< -----server
>>
>> 2.I use /HTTP(S) Test Script Recorder/ to record The whole process
>> above, then
>>      a. I set /"Retrieve All Embedded Resources from HTML Files" /&
>> /"Use concurrent pool/" in the main Request1 to be true,and disable
>> all the  subrequest ,so the sub-request will be sent Automatically
>> *Parallelly*
>>      b.I put a /Regular Expression Extractor/ into main Request1 to get
>> the user session, and set "/Apply to:/"Attribute to be /Main sample
>> and sub-samples/,but *user session can't be Extracted.*
>>      c.if I disable /"Retrieve All Embedded Resources from HTML Files"
>> /& /"Use concurrent pool"/ in the main Request1 ,and enable all the
>> subrequest,move the /Regular Expression Extractor/ into sub-Request3,
>> *user session can be Extracted*.but the sub-request will be sent*in
>> sequence.*
>
> Where is your session attribute embedded? I tried to extract a header
> element -- as I assume that is where the session would be -- and could
> get the value with "Apply to:" set to "Main sample and sub-samples" and
> "Field to check" set to "Response Headers".
>
> You might even get the session header from the HeaderManager, which
> might be easier than deciding which of the headers is the correct one to
> chose from.
>
> Felix
>
>> So,What can I do to satify two demands below?
>> 1. the sub-request will be sent Parallelly
>> 2.user session can be Extracted
>>
>> Thanks!
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
Wicky Tam


Mobile: 13928535226
eMail:  [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A question about HTTP Sampler & Regular Expression Extractor

Felix Schumacher
Seems like this has been continued in

https://bz.apache.org/bugzilla/show_bug.cgi?id=64196

Felix

Am 06.03.20 um 04:41 schrieb 广东设计院谭伟基:

> Hi,Felix Schumacher:
>
> Glad to receive your response,thanks!
>
> "user session" is in the body of sub-sub-response4,just like this:
>
> Line-based text data: text/html (40 lines)
>     <!DOCTYPE html\n
>     \tPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n
>     \t "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n
>     <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">\n
>     <head>\n
>     <title>Web Tours Navigation Bar</title>\n
>     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n
>     </head>\n
>     <body bgcolor="#E0E7F1">\n
> .....
>     <form method="post" action="/cgi-bin/login.pl" target="body">\n
>    <input type="hidden" name="userSession"
> value="128211.168084245zfQtizVpQfiDDDDDDQfzQpVHVHf"/>\n
>     <table border="0"><tr><td>&nbsp;</td>\n
> .....
>
> now, I try to use a Parallel controller which can be select from Plugins Manager to Meet my requirements:
> 1. disable "the Retrieve All Embedded Resources from HTML Files" in the main request.
> 2. add sub-Request2 & sub-response3 into a Parallel controller next to main request.
> 3. enable "the Retrieve All Embedded Resources from HTML Files" & "Use concurrent pool" in the sub-response3.
> 4. put a /Regular Expression Extractor/ into sub-response3 to get user session, and set "/Apply to:/"Attribute to be /Main sample
> and sub-samples/.
> I'm doing the test to check is it a solution to my question.
>
> but,there is a limit to the solution:Parallel controller maybe do not supported to be put under another Parallel controller. it can't do anything if string is in the response of sub-sub-sub-request.
>
>
> 在 2020/3/6 上午5:21, Felix Schumacher 写道:
>> Am 04.03.20 um 07:33 schrieb 广东设计院谭伟基:
>>> Hello,Everyone!
>>>
>>>
>>> I find the/Regular Expression Extractor /can't Extract form the
>>> subrequest of the subrequest. it just can Extract form the subrequest
>>> of the main request.
>>> For example,   there's a scenario like this:
>>> 1. I input the address in the browser,and press the Enter.
>>> browser -----> (main Request1) -----> server
>>> browser <----- (response1)< -----server (response1 contains two
>>> embaded web page  stored in the server.)
>>> browser -----> (sub-Request2) -----> server        (browser sent the
>>> sub-response2 & sub-response3 Automatically Parallelly)
>>> browser -----> (sub-Request3) -----> server
>>> browser <----- (sub-response2)< -----server
>>> browser <----- (sub-response3)< -----server (sub-response3 contains
>>> two embaded web page  stored in the server.)
>>> browser -----> (sub-sub-Request4) -----> server  (browser sent the
>>> sub-sub-Request4 & sub-sub-Request5 Automatically Parallelly)
>>> browser -----> (sub-sub-Request5) -----> server
>>> browser <----- (sub-sub-response4)< -----server (sub-sub-response4
>>> contains a user session)
>>> browser <----- (sub-sub-response5)< -----server
>>>
>>> 2.I use /HTTP(S) Test Script Recorder/ to record The whole process
>>> above, then
>>>     a. I set /"Retrieve All Embedded Resources from HTML Files" /&
>>> /"Use concurrent pool/" in the main Request1 to be true,and disable
>>> all the  subrequest ,so the sub-request will be sent Automatically
>>> *Parallelly*
>>>     b.I put a /Regular Expression Extractor/ into main Request1 to get
>>> the user session, and set "/Apply to:/"Attribute to be /Main sample
>>> and sub-samples/,but *user session can't be Extracted.*
>>>     c.if I disable /"Retrieve All Embedded Resources from HTML Files"
>>> /& /"Use concurrent pool"/ in the main Request1 ,and enable all the 
>>> subrequest,move the /Regular Expression Extractor/ into sub-Request3,
>>> *user session can be Extracted*.but the sub-request will be sent*in
>>> sequence.*
>> Where is your session attribute embedded? I tried to extract a header
>> element -- as I assume that is where the session would be -- and could
>> get the value with "Apply to:" set to "Main sample and sub-samples" and
>> "Field to check" set to "Response Headers".
>>
>> You might even get the session header from the HeaderManager, which
>> might be easier than deciding which of the headers is the correct one to
>> chose from.
>>
>> Felix
>>
>>> So,What can I do to satify two demands below?
>>> 1. the sub-request will be sent Parallelly
>>> 2.user session can be Extracted
>>>
>>> Thanks!
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> --
> Wicky Tam
>
>
> Mobile: 13928535226
> eMail:  [hidden email]