The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP / Mercury LoadRunner

Pages: 1
xtom
Member


Reged: 01/19/04
Posts: 100
Loc: Germany
web_reg_save_param_ex - how can i succeed
      #699442 - 02/24/12 04:26 AM

Hello

This is some relevant part the response data returned from the server (taken from the replay log):

Action.c(276): 0`crf`298`dft`6`t`299`dn`439`9`0`f`0`itx`1`n`421`sc`0`l`100`ibp`1`crf`298`dft`6`t`299`dn`4
Action.c(276): 22`11`0`f`0`itx`1`n`423`sc`0`irq`1`l`50`ibp`1`crf`298`dft`6`iro`1`t`299`dn`343`8`0`f`0`itx
Action.c(276): `1`n`424`sc`0`l`50`crf`298`dft`6`t`299`dn`425`8`0`f`0`itx`1`n`426`sc`0`l`100`crf`298`dft`6
Action.c(276): `t`299`dn`427`11`0`f`0`itx`1`n`308`sc`0`irq`1`l`15`crf`298`dft`6`ihn`1`iro`1`t`301`dn`440`
Action.c(276): 4`4`rl`0`inrk`1`crnm`1`nmr`3`atr`0`2`0`r`0`v`1*N4*Herr0*7*Baumann4*Karl11*Entscheider15*PT
Action.c(276): (Putzt\xFCcher)24*Leiter Metallbearbeitung22*Kaufm\xE4nnischer Einkauf7*1-CDMF4`i`1-CDMF4
Action.c(276): `2`0`r`0`v`1*N4*Frau0*7*Konnert6*Carola14*Sachbearbeiter17*MHL (Handelsware)0*0*8*1-908T5N
Action.c(276): -> `i`1-908T5N`2`0`r`0`v`1*N0*0*9*Unbekannt1*-0*0*0*0*7*1-CDMEZ`i`1-CDMEZ`1`0`tr`0`v``1`2`vi`
Action.c(276): 3``ich`1`0`1`nla`0`19`4`ai`3`S_A3`nfi`1`n`Contact Pick Applet`cud`2*161*12*141*13*2571*12*
Action.c(276): 121*12*201*13*2651*13*2661*13*2061*13*4071*13*4011*13*4041*13*4001*13*4101*13*3901*13*3951
Action.c(276): *13*3971*13*3981*13*3941*13*2671*13*2691*12*101*11*31*13*3851*13*3891*13*3871*13*4281*13*2
Action.c(276): 451*13*4171*03*4261*03*4211*03*4241*03*4231*03*4131*03*4291*03*4301*03*4191*03*4201*03*415

I want to capture the String "Unbekannt" (line marked with "->"). When i use the following web_reg_save_param_ex
command, i succeed.

web_reg_save_param_ex("paramName=NameAnsprechpartner",
"LB=`v`1*N0*0*9*",
"RB=1*",
"Ordinal=1",
LAST);

The parameter "NameAnsprechpartner" contains the value "Unbekannt".

When i try to use this commant with a regular expression as the left boundary, i fail.

web_reg_save_param_ex("paramName=NameAnsprechpartner",
"LB/RE=`v`1\*N0\*0\*9\*",
"RB=1*",
"Ordinal=1",
LAST);

The following error message is given in the replay log:

Action.c(276): Error -35061: No match found for the requested parameter "NameAnsprechpartner". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 2048 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-35061]
Action.c(276): web_custom_request("start.swe_21") highest severity level was "ERROR", 2810 body bytes, 238 header bytes, 12 chunking overhead bytes [MsgId: MMSG-26387]

and i have given the command
web_set_max_html_param_len("2048");
to increase the parameter size.


The only change in the second command is to hide the meta character "*" with the escape character "\". I know in this
example it does not make sense to use a regular expression but this is only the first step. The result will be
to have a regular expression but for now i fail in this simple example.
I verified the expression using "rubular.com" and here i see what i expect.

Thanks and regards
Thomas

--------------------
xtom


Post Extras: Print Post   Remind Me!   Notify Moderator  
saharinivas
Member


Reged: 04/24/08
Posts: 199
Re: web_reg_save_param_ex - how can i succeed [Re: xtom]
      #699445 - 02/24/12 04:41 AM

Hi Thomas,

When first method works, adopt the same in test script.

Please make a note sophisticated use of regular expressions make a Vuser script harder to understand,debug and adversely affects performance.

Avoid careless and unnecessary use of REs. For example, use of REs like ".+" and ".*" can have unexpected results.It will not properly extract correct values.

Regards,
Mahesh.S


Post Extras: Print Post   Remind Me!   Notify Moderator  
xtom
Member


Reged: 01/19/04
Posts: 100
Loc: Germany
Re: web_reg_save_param_ex - how can i succeed [Re: saharinivas]
      #699450 - 02/24/12 04:51 AM

hello Mahesh!

The first method is not sufficient. Part of the left boundary may change. This is SIEBEL and depending on the screen content the last "*9*" may be "*5*" it the string is "Buddy" instead of "Unbekannt" (5 instad of 9 characters).
But if do not succeed with this simple example i do not need to squeeze my brain for a more compelx regular expression ...

Thanks
Thomas

--------------------
xtom


Post Extras: Print Post   Remind Me!   Notify Moderator  
JimHowell1970Moderator
Active Member


Reged: 02/18/10
Posts: 836
Loc: Europe
Re: web_reg_save_param_ex - how can i succeed [Re: xtom]
      #699451 - 02/24/12 05:15 AM

Tom

I've worked extensively with Siebel in regular web protocol

my advice is to abandon the idea of correlating individual elements of star arrays and to grab the whole array and chop it up in code (sounds like a pain and it is, but once it's done, it's done - stick it in a function)

this will allow you to implement randomness in your script much more successfully

Jim


Post Extras: Print Post   Remind Me!   Notify Moderator  
xtom
Member


Reged: 01/19/04
Posts: 100
Loc: Germany
Re: web_reg_save_param_ex - how can i succeed [Re: JimHowell1970]
      #699453 - 02/24/12 05:35 AM

Hello Jim!

Thanks for your response (i knew why i added the word SIEBEL in my post ...).

I would like to avoid doing this manually - but this is the fallback solution of course.
But why is LoadRunner not doing what i want it to do? In a different environment regular expressions may be very helpful.

Thanks
Thomas

--------------------
xtom


Post Extras: Print Post   Remind Me!   Notify Moderator  
Oliver_Lloyd
Member


Reged: 06/04/11
Posts: 246
Loc: London, England
Re: web_reg_save_param_ex - how can i succeed [Re: xtom]
      #699465 - 02/24/12 06:49 AM

I'm not at a machine with LR on so I can't check but I don't think you can use regexps with web_reg_save_param_ex. Try using web_reg_save_param_regexp instead (only in LR11+).

Note. A standard regexp to grab this would be

`v`1\*N0\*0\*9\*([^1]*)

The parenthesis define the match (not LB or RB). But you'll probably need to extend the regexp to make it more reliable. More like this:

`[a-z]`[0-9]\*[A-Z][0-9]\*[0-9]\*[0-9]\*([^1\*]*)

I wrote about this subject here.

--------------------
http503.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
xtom
Member


Reged: 01/19/04
Posts: 100
Loc: Germany
Re: web_reg_save_param_ex - how can i succeed [Re: Oliver_Lloyd]
      #699471 - 02/24/12 07:22 AM

Hello Oliver!

Thanks for your reply. You tell me what i did not want to believe but what may be the reality: LR11 does not support regular expressions in "web_reg_save_param_ex" although the help has some documentation about it.
LR11 does not know the command "web_reg_save_param_regexp". I tried that based on your documentation which i consulted before but i thought this unknown name was a typo in your text.

I think i need to install patch 3 to get the command available. But be sure then i will check your pattern and if it succeeds my task is nearly finished ... (additional remark: the digit 9 inicates the length of the following field and this may be more than 9. So in this case i need to add a + sign to pattern and also to some others too).

In the meantime i will create a little function like Jim suggested.

Thanks
Thomas

--------------------
xtom


Post Extras: Print Post   Remind Me!   Notify Moderator  
thorwath
Veteran


Reged: 07/22/99
Posts: 3840
Loc: Grand Rapids, MI
Re: web_reg_save_param_ex - how can i succeed [Re: xtom]
      #699589 - 02/26/12 01:20 PM

I just checked and vuGen 11 help surely does support web_reg_save_param_regexp. And web_reg_save_param_ex confusingly states:

Quote:


In release 11.00, the /RE qualifier was supported. This support is discontinued because fuller regular expression functionality is now provided by web_reg_save_param_regexp.





That is terribly worded (but what's new with LR documentation?), because if you are using version 11.03 (which you should be) is /RE supported or not? I think the answer is it is not.

At any rate use web_reg_save_param_regexp when it is available.


Post Extras: Print Post   Remind Me!   Notify Moderator  
JimHowell1970Moderator
Active Member


Reged: 02/18/10
Posts: 836
Loc: Europe
Re: web_reg_save_param_ex - how can i succeed [Re: thorwath]
      #699642 - 02/27/12 07:55 AM

having had a fair it of experience performance testing siebel with LR, I'd strongly advise you to go the route of grabbing the whole star array and chopping it up...

this is a known working solution... & how siebel-web protocol works

use of regexs to get at individual elements of star arrays, is not proven and may end up with issues when different users don't return exactly the same shape data set

but you could always try it and tell us!!!


Post Extras: Print Post   Remind Me!   Notify Moderator  
xtom
Member


Reged: 01/19/04
Posts: 100
Loc: Germany
Re: web_reg_save_param_ex - how can i succeed [Re: JimHowell1970]
      #699720 - 02/27/12 10:35 PM

Hello!

At the moment the situation is the following: On my VUGen the command "web_reg_save_param_regex" was not available. Reason: The patch applied did not succeed to install correcly. After this was done, the command and the help text were available. So - now i will NOT use the command "web_reg_save_param_ex" to solve my problem because it does not work!

@thorwath
Your hint gave me the right path to have a look to the point where the problem exist - the wrong command and the missing patch.

@Jim
I have created a function to extract the desired element from the StarArray so that i can use it in the script. But nothing at all i will also check the function "web_reg_save_param_regex" more intensive. May be i will see it works or i will forget it. But at the end i know the capabilities of this command and it may be useful for a different task.

Thanks
Thomas

--------------------
xtom


Post Extras: Print Post   Remind Me!   Notify Moderator  
TeeJay0469
Member


Reged: 11/03/10
Posts: 43
Loc: MN, USA
Re: web_reg_save_param_ex - how can i succeed [Re: xtom]
      #701811 - 03/19/12 01:01 PM

I thought I would add in my 2 cents worth and add a tip....

I "THINK" your original request had possibly failed since you had not escaped out the * in your RB call (ie RB/RE=1\*",


Now for my cool find......

I was pulling my hair out for 2 days working on a script myself with LR Ver 11.0 and the web_reg_save_param_ex using the help as my guide. Here is the line from the server I needed to param:

<a href="javascript:gotoPatient('564')" onmouseover="ajax_showTooltip('564','PATIENT_RECORD_INFO',this);return false" onmouseout="ajax_hideTooltip()">ACHAT,NYLIXY</a></td>


I needed to RE the 564 (2 of them) and the ACHAT,NYLIXY is the data I needed to grab. The LB is the only one I needed to RE and it SHOULD have looked like this based on the help file:

"LB/RE=<a href=\"javascript:gotoPatient\('[0-9]*'\)\" onmouseover=\"ajax_showTooltip\('[0-9]*','PATIENT_RECORD_INFO',this\);return false\" onmouseout=\"ajax_hideTooltip\(\)\">",


After farting around with it, changing the [ & ] with ( & ), escaping and not escaping the ( & ), with no luck, I shortened down the LB to just the:

gotoPatient\('[0-9]*'\)\"


and proceded to try every possible combinations I could think of. I finally took it down to this:

gotoPatient\('[0-9]* and gotoPatient('[0-9]*


which both gave me the error:

Failed to compile "<a href="javascript:gotoPatient('[0-9]*" as Regular Expression, parentheses not balanced.


This lead me to think I had something goofy with the ( & ), or that I just could not use them at all.....


So on a whim, I double escaped the ( & ) in the line to look like this:

"LB/RE=<a href=\"javascript:gotoPatient\\('[0-9]*'\\)\" onmouseover=\"ajax_showTooltip\\('[0-9]*','PATIENT_RECORD_INFO',this\\);return false\" onmouseout=\"ajax_hideTooltip\\(\\)\">",


and was floored (actually tickled pink) when it worked. SO, with all of that said, if you have ( and/or ) in your boundries with RE, make sure you double escape them!!!

Tom Johnson


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 31 anonymous users are browsing this forum.

Moderator:  AJ, James Pulley, ptrussell_nc, JimHowell1970 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 6025

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5