LoadRunner 11.52 Function reference code issues (566 Views)
Reply
Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 1 of 5 (566 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?

Respected Contributor
Srihari_Amgen
Posts: 426
Registered: ‎11-25-2011
Message 2 of 5 (546 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 

Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 3 of 5 (526 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.

 

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 4 of 5 (515 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*".

Frequent Advisor
KF1
Posts: 59
Registered: ‎11-30-2011
Message 5 of 5 (504 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.

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.