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 7 Desktop", 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

  • 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:



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

    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);

  • 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

     

  • Can you please provide sample of the issue?