Highlighted
Absent Member.. Absent Member..
Absent Member..
1993 views

CAn I extract a token from a web_add_auto_header command

Hi,

I am writing a multi VUGen script of HTTP & Citrix, in Loadrunner 12.5.

I have hit an issue where the recording has generated the below:

    web_add_auto_header("Csrf-Token", 
        "8E3FABEB3F3C95F3D2FBE9B06E84291A");

The underlined text is a token that changes per session and is used further down the script to make the below call:

ctrx_nfuse_connect("https://{server}/Citrix/StoreWeb/Resources/LaunchIca/{token}.ica?CsrfToken=8E3FABEB3F3C95F3D2FBE9B06E84291A&IsUsingHttps=Yes&launchId={launchID}&displayNameDesktopTitle=Windows%207%20Desktop", CTRX_LAST);

Is there a way to make extract this token prior to the web_add_auto_header to parameterise it in the call further down.

I've had a look around but I can't find a great deal of information on the web_add_auto_header. But i haven't found anything that looks to do this.

If this is not possible, is there a workaround to get around this issue?

Thanks

0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

Hi,

I assume you are recording the script against Citrix StoreFront. It is supported out of the box since LR 12.00, so you don't need to parameterize Csrf-Token manually. Please check Recording Options:

Correaltions->Rules:   Citrix_Xenapp group should be enabled:

citrix_correlation_rules.png

HTTP Properties->Advanced->Record headers in list:

storefront_headers.png

With these settings all the necessary steps will be generated automatically:

    web_reg_save_param_ex(
        "ParamName=CsrfToken",
        "LB=CsrfToken=",
        "RB=;",
        SEARCH_FILTERS,
        "Scope=Cookies",
        "IgnoreRedirections=No",
        "RequestUrl=*/Configuration*",
        LAST);
...
    web_add_auto_header("Csrf-Token",
        "{CsrfToken}");

...
ctrx_nfuse_connect("http://......./LaunchIca/.......-.ica?CsrfToken={CsrfToken}&IsUsingHttps=No&launchId=1463063120888", CTRX_LAST);

Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Hi,

I have the same problem and tryied aboce settings  but for me automatic correlations are not done.

could anyone help me out here

BR,

KHB

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Can you please provide sample of the issue?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.