Re: How to use Additional Attributes (683 Views)
Reply
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 1 of 7 (756 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

Frequent Advisor
asr_Dennis
Posts: 37
Registered: ‎04-11-2013
Message 2 of 7 (725 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.
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 3 of 7 (717 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

Frequent Advisor
asr_Dennis
Posts: 37
Registered: ‎04-11-2013
Message 4 of 7 (697 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.
Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 5 of 7 (683 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.

Occasional Advisor
HardcoreTester
Posts: 14
Registered: ‎11-12-2013
Message 6 of 7 (653 Views)

Re: How to use Additional Attributes

Perhaps it just works different in the TruClient protocol.

Has anybody an idea how?

Occasional Visitor
GeorgiPS
Posts: 1
Registered: ‎08-30-2011
Message 7 of 7 (585 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

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.