UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.
Absent Member.
13208 views

Saving the web_reg_save_param value in a file

Jump to solution

Hi All,

 

Can anyone help me in saving the correlated value(From Web_Reg_Save_Param) into a file. Thanks in advance

0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

Hello!

 

The last two lines of your code need to be the following:

 

  lr_save_string(lr_eval_string("{remo_1}"), "remoToUse");

  lr_output_message("Value for remo is %s ", lr_eval_string("{remoToUse}"));

 

This saves the content of "remo_1" into a string named "remoToUse".

 

Kind regards

Thomas

View solution in original post

0 Likes
9 Replies
Absent Member.
Absent Member.

Hello!

 

You can use "lr_output_message()" or "lr_log_message()" to save the content of the variable in the vuser log file. From there you can get it after the test is finished.

 

Regards

Thomas

0 Likes
Absent Member.
Absent Member.

This is in Vugen 9.5 version and below is the function i used to capture an array of values. I tried to print the value with the following code but found unsuccessful.

 

char *r;

web_reg_save_param("remo",
        "LB=</td><td style=\"border-color:White;\">",
        "RB=</td>",
        "Ord=ALL",
        "NotFound=ERROR",
        "IgnoreRedirections=Yes",
        LAST);

r=lr_eval_string("{remo_1}");

lr_output_message("Values for remo is :%s",r);

0 Likes
Absent Member.
Absent Member.

Hello!

 

The last two lines of your code need to be the following:

 

  lr_save_string(lr_eval_string("{remo_1}"), "remoToUse");

  lr_output_message("Value for remo is %s ", lr_eval_string("{remoToUse}"));

 

This saves the content of "remo_1" into a string named "remoToUse".

 

Kind regards

Thomas

View solution in original post

0 Likes
Absent Member.
Absent Member.

Thanks thomas for your timely response. I have tried with the sugested way. However iam getting the output as below

 

Action.c(1296): web_set_max_html_param_len was successful      [MsgId: MMSG-26392]
Action.c(1298): Registering web_reg_save_param was successful      [MsgId: MMSG-26390]
Action.c(1314): Value for remo is {remo_1}

 

Thanks,

Remo

0 Likes
Absent Member.
Absent Member.

Hello!

 

Do you have placed the web_reg_save_param before the request that returns the result? Only after the request is executed you can do the lr_output_message.

The sequence is

  1: web_reg_save_param

  2: your request

  3: lr_output_message

 

Kind regards

Thomas

0 Likes
Absent Member.
Absent Member.

Thanks thomas...the above code mentioned is working...The error was basically due to misplace of the pointer variable declared...

0 Likes
Absent Member.
Absent Member.

What if i want to save/process  "Ord=All" values in script ??

 

0 Likes
Absent Member.
Absent Member.

web_reg_save_param("JsonData",
    "LB=",
    "RB=",
    "Search=Body",
    LAST);    
using the above function in getting the response from the RestAPI
using below function to get the value from the JsonData 

    lr_json_get_values("JsonObject=JsonData","QueryString=$.StoreNumber","ValueParam=number",LAST);

 

Getting following error:

Saving Parameter "JsonData = {"StoreNumber":"1","........................................................................................}
Action.c(22): Error: No JSON Object was found for the specified parameter name: "JsonData ".
Action.c(22): Error: lr_json_get_values failed

 

 

can you please help in getting the value of json into an variable or object so I could use it further ?

Thanks

0 Likes
Absent Member.
Absent Member.

Hi

i have one soap we bservice ,when its ran ,it will give me one unique id, that i want to store in file and also use in second API's input.

 

my code is like below:

lr_start_transaction("NRTE");
        
        web_reg_save_param("<message>","LB=\"","RB=\"","Ord=2",LAST);
        web_service_call( "StepName=SaveRequest_101",
        
        "SOAPMethod=SGLAWSService|FGLAWSPort|SaybackSaveRequest",
        "ResponseParam=response",
        "Service=FGLAWSService",
        "ExpectedResponse=SoapResult",
        "Snapshot=t1490782857.inf",
        BEGIN_ARGUMENTS,
        "xml:arg0="
            "<arg0>"
                "<cardDiscount></cardDiscount>"
                "<cardNo>{CardNo}</cardNo>"
                "<cashMemoDate>01-05-2017</cashMemoDate>"
                "<couponCode></couponCode>"
                "<mcDetails>1218@1@2500@35.00</mcDetails>"
                "<paymentCardNumbers></paymentCardNumbers>"
                "<paymentMode>CASH-CASH@2500</paymentMode>"
                "<siteCode>2559</siteCode>"
                "<terminalNo>9</terminalNo>"
                "<totalPointsRedeem></totalPointsRedeem>"
                "<transactionNo>{txn_no}</transactionNo>"
            "</arg0>",
            
            
        END_ARGUMENTS,
        BEGIN_RESULT,
        END_RESULT,
        LAST);
        lr_end_transaction("NRTE",LR_AUTO);

 

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.