LoadRunner 11.52 Function reference code issues (361 Views)
Reply
Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 1 of 5 (361 Views)
Accepted Solution

LoadRunner 11.52 Function reference code issues

I am sure this is something I am doing incorrectly, but when I copy and paste the following from the function reference into my action I am getting the following errors:

 

 

 

 

Do I need an extra include statment or something?

Please use plain text.
Respected Contributor
Srihari_Amgen
Posts: 421
Registered: ‎11-25-2011
Message 2 of 5 (341 Views)

Re: LoadRunner 11.52 Function reference code issues

[ Edited ]

Hi KF1,

 

I do not have Vugen 11.52, but when I ran the same code from Vugen 11 Patch 4 it worked fine.

 

IP Spoofing.png

 

May be you have to delete the blank lines which are present in your code.

 

Make sure you copy the code in the Action section.

 

Action()

{

.....................

.......Our Code.

......................

}

 

Regards,

Srihari 

Please use plain text.
Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 3 of 5 (321 Views)

Re: LoadRunner 11.52 Function reference code issues

Thanks so much for your reply.  I took a better screenshot.  I cant figure out what is wrong.  It makes no sense to me.  Does anyone know why this isnt working?  Is it a bug?

 

 

The red box has errors, the green box is my modified(bad practice) code that works.

 

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,757
Registered: ‎03-06-2006
Message 4 of 5 (310 Views)

Re: LoadRunner 11.52 Function reference code issues

>Does anyone know why this isn't working?

 

If this is C89, you can't have declarations in the middle of a block.  You need C++ or C99 to do that.

(That's why it worked for Srihari_Amgen.)

 So move that "char *ip;" up.

 

Note: If not modifying "ip", you should declare it "const char*".

Please use plain text.
Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 5 of 5 (299 Views)

Re: LoadRunner 11.52 Function reference code issues

Excellent thanks for the help.  I was able to get it working by moving the declaration right above the Action.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation