Regular expression help

87 views
Skip to first unread message

timothy ma

unread,
Apr 12, 2016, 9:53:31 PM4/12/16
to LoadRunner
Hi

I tried to capture the parameter:

"Name=ICSID", "Value=3VHRtC3ACS5oSLnLd/GWR+261ZflrsnF8LgVXuM+Afo=", ENDITEM,

I create a regular expression like

web_reg_save_param("ICSID", "LB=Name=ICSID", "Value=", "RB=",
  LAST );

But it is not working.

Appreciate if someone can give me advice.

Also, how can I test if the expression has worked before I replay the script in VUGEN?

I can only find my expression not working when replay the script.

In JMETER, I remember we can test REGEX first.

Great thank.


Sagar Aggarwal

unread,
Apr 13, 2016, 11:17:34 AM4/13/16
to LR-Loa...@googlegroups.com

You have to provide escape character / before = & ". It will work then

Regards,
Sagar Aggarwal
Technical Testing Lead | Infosys Limited | Chandigarh
(M) +917875624650

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/5ab0085c-0040-4381-bb20-f28bf431fcff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevyland

unread,
Apr 13, 2016, 11:17:34 AM4/13/16
to LoadRunner

You do understand you need to escape quotes in your LB/RB blocks?

something like: web_reg_save_param("ICSID", "LB=ICSID\", \"Value=", "RB=\"",   LAST );

Why did you not include an LR_output_message after the capture to see what you got in the param? 

Siva

unread,
Apr 13, 2016, 11:17:37 AM4/13/16
to LoadRunner
Hi Timothy,

Change the web_reg_save... function as below


web_reg_save_param("ICSID", "LB=Name=ICSID\", \"Value=", "RB=\"",
  LAST );

pramod rath

unread,
Apr 13, 2016, 11:17:37 AM4/13/16
to LR-Loa...@googlegroups.com

Correct format/syntax is like

web_reg_save_param("ICSID", "LB=Name=ICSID\", \"Value=", "RB=\"", 
  LAST );

You need to use escape sequence where   (") appears in boundaries.

Try now
Pramod

Anand Gattu

unread,
Apr 13, 2016, 9:41:33 PM4/13/16
to LR-Loa...@googlegroups.com

U forgot the escape character

André Luyer

unread,
Apr 14, 2016, 5:25:41 PM4/14/16
to LoadRunner
Am I correct that the listed "parameter" is in fact a snippet of the generated code in Vugen?
That would explain why your web_reg_save_param does not work -- even if the double quotes (") are properly escaped.
In that case look for the data that was actually returned by the webserver instead (i.e. the "code generation" log).

For regex use the function web_reg_save_param_regexp (web_reg_save_param does not use regex).
There are several sites allowing you to test a regex, like https://regex101.com/ .

André

James Pulley

unread,
Apr 14, 2016, 5:33:19 PM4/14/16
to LoadRunner
You need training.  You are attempting to correlate where a value is being sent back by LoadRunner, not where the value is being generated and sent by the server.   This architectural misperception needs to be addressed through training on the tool and mentoring, with an HP certified instructor.  Anything other than an HP Certified instructor and is of dubious value - 99% of the time they will take your money and leave you with no usable skills.  If your management is unwilling to provide you both training and a mentor then you should assume that they have set you up for failure.

This is not your fault.  It is the fault your management that you are in this predicament

MODERATOR
Reply all
Reply to author
Forward
0 new messages