jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From praveen tiwari <praveentiwa...@gmail.com>
Subject Re: Passing values from regular expression
Date Thu, 22 Jun 2017 07:06:14 GMT
Hi Felix,

Please find below an explanation in more detail:

HTML Response:

------------------------------------------------------------
------------------------------------------------------------
-------------------------------------
*FareID1:*
<input type="radio" name="timeoutbound1" value=""
id="ae3dc705-d5dc-4729-9288-133e036c1cda"
optid="ae3dc705-d5dc-4729-9288-133e036c1cda" />
<input type="radio" name="timeoutbound1" value=""
id="22c7814f-e145-4082-86a2-09c2f922b893"
optid="22c7814f-e145-4082-86a2-09c2f922b893" />
<input type="radio" name="timeoutbound1" value=""
id="dbb1033f-9500-4b06-b753-67b922a7b1f9"
optid="dbb1033f-9500-4b06-b753-67b922a7b1f9" />
<input type="radio" name="timeoutbound1" value=""
id="ebed167d-548d-47b8-a96b-bb98bff68f01"
optid="ebed167d-548d-47b8-a96b-bb98bff68f01" />

<input type="radio" name="timeinbound1" value=""
id="60f3e222-b8a3-4b12-87e1-cb783a044b44"
optid="60f3e222-b8a3-4b12-87e1-cb783a044b44" />
<input type="radio" name="timeinbound1" value=""
id="f2a18f88-e87f-47f7-a31a-1cc92b905348"
optid="f2a18f88-e87f-47f7-a31a-1cc92b905348" />
<input type="radio" name="timeinbound1" value=""
id="dae19c11-dfa3-4483-8c0c-b06f0ec28c07"
optid="dae19c11-dfa3-4483-8c0c-b06f0ec28c07" />
<input type="radio" name="timeinbound1" value=""
id="5852bc68-461e-4570-b5ea-fb85f4367c18"
optid="5852bc68-461e-4570-b5ea-fb85f4367c18" />

<input id="fareRefId_1" name="FareRefId" type="hidden"
value="7f9a6381-9569-4af2-884f-16dd39332a9a" />

*FareID2:*
<input type="radio" name="timeoutbound2" value=""
id="ae3dc705-d5dc-4729-9288-133e036c1cda"
optid="ae3dc705-d5dc-4729-9288-133e036c1cda" />
<input type="radio" name="timeoutbound2" value=""
id="22c7814f-e145-4082-86a2-09c2f922b893"
optid="22c7814f-e145-4082-86a2-09c2f922b893" />
<input type="radio" name="timeoutbound2" value=""
id="dbb1033f-9500-4b06-b753-67b922a7b1f9"
optid="dbb1033f-9500-4b06-b753-67b922a7b1f9" />
<input type="radio" name="timeoutbound2" value=""
id="ebed167d-548d-47b8-a96b-bb98bff68f01"
optid="ebed167d-548d-47b8-a96b-bb98bff68f01" />

<input type="radio" name="timeinbound2" value=""
id="d62dbf99-cc3e-48e0-acf9-87fd8490b4bf"
optid="d62dbf99-cc3e-48e0-acf9-87fd8490b4bf" />
<input type="radio" name="timeinbound2" value=""
id="41c060f6-4080-4b38-babf-d7ffb74b3b23"
optid="41c060f6-4080-4b38-babf-d7ffb74b3b23" />
<input type="radio" name="timeinbound2" value=""
id="f2a18f88-e87f-47f7-a31a-1cc92b905348"
optid="f2a18f88-e87f-47f7-a31a-1cc92b905348" />
<input type="radio" name="timeinbound2" value=""
id="dae19c11-dfa3-4483-8c0c-b06f0ec28c07"
optid="dae19c11-dfa3-4483-8c0c-b06f0ec28c07" />

<input id="fareRefId_2" name="FareRefId" type="hidden"
value="7f9a6381-9569-4af2-884f-16dd39332a9a" />
------------------------------------------------------------
------------------------------------------------------------
-------------------------------------

For "*fareRefId_1*" there are* multiple values of "timeinbound1" and
"timeoutbound1". *
For "*fareRefId_2*" there are* multiple values of "timeinbound2" and
"timeoutbound2". *

Similarilty there are multiple "fareRefId_No." in my response.

Scenario is that I need to extract value of "timeinbound" and "timeoutbound"
depending on the value of fareRefId_No.
e.g. if fareRefId_2 - pass any value of "timeinbound2" and "timeoutbound2".
fareRefId_9 - pass any value of "timeinbound9" and "timeoutbound9".

I have added a "counter" config element in a while loop before calling the
request containing below regular expression.

*Counter Config Element:*
Start: 2
Increment: 1
Reference name: Count

*Regular Expression used:*

Variable: FareReferenceId
Reg Exp: <input id="fareRefId_(.+?)" name="FareRefId" type="hidden"
value="(.+?)" />
Template: $1$$2$
Match No. ${Count}
Variable Passed: ${FareReferenceId_g2}

Variable: Timeinbound
Reg Exp: <input type="radio" name="timeinbound(.+?)" value="" id="(.+?)"
optid
Template: $1$$2$
Match No. ${Count}
Variable Passed: ${Timeinbound_g2}

Variable: Timeoutbound
Reg Exp: <input type="radio" name="timeoutbound(.+?)" value="" id="(.+?)"
optid
Template: $1$$2$
Match No. ${Count}
Variable Passed: ${Timeoutbound_g2}

Issue I am facing is that if counter = 2, it passed 2nd value of fareRefId,
Timeinbound and TimeOutbound, while I need if counter = 2, it should pass
second value of  fareRefId and any value of Timeinbound2 and TimeOutbound2,

Please let me know if you need more information.

On 22-Jun-2017 11:06 am, "Felix Schumacher" <
felix.schumacher@internetallee.de> wrote:

>
>
> Am 21. Juni 2017 18:31:43 MESZ schrieb praveen tiwari <
> praveentiwari5@gmail.com>:
> >Hi All,
> >
> >I have a scenario as below and seeking for help on same.
> >
> >I have a request and it's response contains data as below which I am
> >able
> >to extract using regular expression:
> >
> >For
> >Fare 1
>
> What is fare? I don't understand it?
>
> >ABC 1, ABC 1, ABC 1 (multiple times)
> Is ABC 1, ABC 1, ABC 1 already multiple times, or is it three times x ABC 1
>
> Maybe you could give a more concrete example with?
>
> >XYZ 1, XYZ 1, XYZ 1  (multiple times)
> >
> >Fare 2
> >ABC 2, ABC 2, ABC 2 (multiple times)
> >XYZ 2, XYZ 2, XYZ 2  (multiple times)
> >
> >Fare n
> >ABC n, ABC n, ABC n (multiple times)
> >XYZ n, XYZ n, XYZ n  (multiple times)
> >
> >Required scenario is:
> >when I am getting fare 1, I need to select ABC 1 and XYZ 1.
> >when I am getting fare 2, I need to select ABC 2 and XYZ 2.
> >when I am getting fare n, I need to select ABC n and XYZ n.
> >
> >Problem I am facing is I am able to fetch "fare n" but when same number
> >(n)
> >is applied on ABC/XYZ in regular expression (templates), I am getting
> >value
> >from different fare section. e.g if I consider fare 2 (defined number
> >in
> >regexp template is 2), I am getting 2nd value from Fare 1 (ABC 1 and
> >XYZ 1
> >which is at 2nd position).
>
> I don't understand the description. Could you give the concrete regex and
> templates you are using?
>
> Regards,
>  Felix
>
> >
> >Any help with implementation of above login would be highly
> >appreciated.
> >If required more details, please let me know.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message