LoadRunner Support Forum
Showing results for 
Search instead for 
Do you mean 

How to use Additional Attributes

Occasional Advisor

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

6 REPLIES
Trusted Contributor

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 thumbs up icon in the purple square by the post in the thread.
Occasional Advisor

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

Trusted Contributor

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 thumbs up icon in the purple square by the post in the thread.
Highlighted
Occasional Advisor

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

Re: How to use Additional Attributes

Perhaps it just works different in the TruClient protocol.

Has anybody an idea how?

Visitor

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