How to use Additional Attributes (299 Views)
Reply
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 1 of 7 (299 Views)

How to use Additional Attributes

[ Edited ]

How can i use the value of an additional attribute (from the Run-time settings) in my TruClient Ajax IE script.

For instance to replace a part of an url with this value so the script can be used on another testenvironment.

 

P.S. This thread has been moved from Performance Center Support and News Forum to LoadRunner Support Forum. -HP Forum Moderator

Please use plain text.
Frequent Advisor
asr_Dennis
Posts: 34
Registered: ‎04-11-2013
Message 2 of 7 (268 Views)

Re: How to use Additional Attributes

Hi,

In your RunTime Settings(RTS) under 'Additional Attributes' add a new argument name and a argument value. For example: argument name 'Test' with value 'Hello'

Use the statement lr_get_attrib_string("<Argument Name>") to retrieve the argument value.

In our example use: lr_get_attrib_string("Test") to retrieve the value 'Hello'.
NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the white star in the purple square by the post in the thread.
Please use plain text.
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 3 of 7 (260 Views)

Re: How to use Additional Attributes

In the additional attributes i add a entry called Url.

In the TruClient for IE browser i have a step navigate to.

In the navigation field i enter lr_get_attrib_string("Url").

When i excecute this step i get an error:

 

 

ReferenceError: 'lr_get_attrib_string' is undefined

Please use plain text.
Frequent Advisor
asr_Dennis
Posts: 34
Registered: ‎04-11-2013
Message 4 of 7 (240 Views)

Re: How to use Additional Attributes

Hi,

Store it in a parameter: lr_save_string(lr_get_attrib_string("Url"), "Url");

I'am not familar with the TruClient Ajax IE script but this trick works on web/html scripts.
NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the white star in the purple square by the post in the thread.
Please use plain text.
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 5 of 7 (226 Views)

Re: How to use Additional Attributes

When i use this code in a Evaluate JavaScript (or C) block, both lr_save_string and lr_get_attrib_string are undefined.

I am using vewrsion 11.50 vuGen.

Please use plain text.
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 6 of 7 (196 Views)

Re: How to use Additional Attributes

Perhaps it just works different in the TruClient protocol.

Has anybody an idea how?

Please use plain text.
Occasional Visitor
GeorgiPS
Posts: 1
Registered: ‎08-30-2011
Message 7 of 7 (128 Views)

Re: How to use Additional Attributes

In Truclient it is 

 

LR.getLRAttr("<attrib_name>")

 

It is discribed in Vugen help >> Vugen >> Protocols >> Ajax Truclient >> Enhancing Ajax Truclient Script >> Ajax Truclient Functions

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation