0

I have a java virtual user script that is sending a payload request. I am trying to use values from a file to send via a loadrunner file parameter.

here is the payload:

private static final String PAYLOAD =
            "<ips_cad_mdt>\n" + 
            "   <SignOnRequest>\n" + 
            "       <DestApplication>hhhh</DestApplication>\n" + 
            "       <OrigApplication>hhh</OrigApplication>\n" + 
            "       <SessionRef>3</SessionRef>\n" + 
            "       <Aliasing>1234</Aliasing>\n" + 
            "   </SignOnRequest>\n" + 
            "</ips_cad_mdt>";

I would like to use something like the following:

private static final String PAYLOAD =
            "<ips_cad_mdt>\n" + 
            "   <SignOnRequest>\n" + 
            "       <DestApplication>hhh</DestApplication>\n" + 
            "       <OrigApplication>hhh</OrigApplication>\n" + 
            "       <SessionRef>3</SessionRef>\n" + 
            "       <Aliasing>”+lr.eval_string(“{AliasId}”)+”</Aliasing>\n" + 
            "   </SignOnRequest>\n" + 
            "</ips_cad_mdt>";

for some reason i cant see any output for this value. do i need to declare a variable: e.g. lr.save_string("AliasId", "{AliasId}");

an example of this would help loads. Many Thanks

1 Answer 1

1

There seems to be an error in the code completion in VuGen. The parameters should be reversed and without the {} in save_string.

    lr.save_string("1234","myId");
    lr.message(lr.eval_string("{myId}"));

In the documentation it is correct - https://admhelp.microfocus.com/lr/en/12.55/help/function_reference/FuncRef.htm#FuncRef/c_vuser/lrFr_lr_save_string.htm?Highlight=lr_save_string

I asked the responsible team to fix the code completion in VuGen so you will be able to see this change in one of the future releases.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.