Re: C Vuser - parsing failed even though systax is correct and script runs (511 Views)
Reply
Occasional Advisor
HenriqueAbreu
Posts: 11
Registered: ‎02-14-2014
Message 1 of 5 (549 Views)
Accepted Solution

C Vuser - parsing failed even though systax is correct and script runs

[ Edited ]

I think I've stumbled on a bug in VuGen (Version 11.52 Build 4391).

 

I was writing C code and got a "Script parsing failed" even though my code was correct. I even ran it and it replayed successfully. But this parsing failed message stuck and it causes lots of "misbehaviors" on VuGen. So I started simplifying my script to nail it down. This is what I got:

 

Action()
{
    char *str = "ab";
    
    if (str[0] == 'b')
        str[1] = 'c';

    lr_output_message("%s", str);
    return 0;
}

 

What I noticed is that every time I have a criteria (on a while or if clause, for example) that checks for a single char. The parsing fails.

 

There some crazy conditions that make this bug go away. One I found is to add a double-quote in the next statement or even a comment. From example, in the code above, adding the following comment makes the parsing succeed:

    if (str[0] == 'b') //" 
        str[1] = 'c';

 

Now to my question... Can you reproduce this? Where do we report bugs to HP LoadRunner?

HP Expert
vmanolova
Posts: 532
Registered: ‎05-24-2012
Message 2 of 5 (511 Views)

Re: C Vuser - parsing failed even though systax is correct and script runs

 

Hi,

 

 

Thank you for this question. We have tried to reproduce the compilation issue on several machines and it does not reproduce.

 

 

Please review the following knowledge document Error: "Script parse failed, please fix the errors before scanning" when opening the Design Studio in the LoadRunner VuGen 11.5x

 

http://support.openview.hp.com/selfsolve/document/KM00423368

It explains that the error message appears because VuGen parser does not currently support referencing a typedef that is declared in a script.

 

 

I want to check if in some of the other files in the script some line of code could be causing the error message. Could you please make an empty script without any additional lines of code in the header file, paste the code you have provided and check if the issue will reproduce.

 


Additionally you are attempting to modify a const string, which str is pointing to. The correct way to do it is
char str[3];
strcpy(str, "ab");

 

 

Please let us know the outcome.

 

Kind regards,

 

HP Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
Occasional Advisor
HenriqueAbreu
Posts: 11
Registered: ‎02-14-2014
Message 3 of 5 (507 Views)

Re: C Vuser - parsing failed even though systax is correct and script runs

[ Edited ]

Yes, the parse still fails when I copy this code into an new C Vuser. There's no typedef or anything else.

 

Thanks for the code tip. I don't really use this code though, it's just to make a point on the syntax issue.

 

Please note that it is not exactly a compilation error, since the script is compiled and runs fine, it's just a parsing problem on LoadRunner "IDE".

 

By the way, when I tried to access the link provided it says I'm not authorized. Which is weird since I have a valid LoadRunner SAID contract number associated with my account.

 

I have attached my detailed LR versions. I'm on a PC running Win 7 Pro SP1.

 

Thanks for your assistance.

HP Expert
vmanolova
Posts: 532
Registered: ‎05-24-2012
Message 4 of 5 (486 Views)

Re: C Vuser - parsing failed even though systax is correct and script runs

Hi Henrique,

 

Please try to access the document. You should be able to review it now.

Could you please open a case with support, so that we can investigate the issue in more details.

We will need more information from your environment. Please provide the script and LRDetect report generated by LRDetect tool available for download from the following link:  http://support.openview.hp.com/selfsolve/document/KM00664831

 

When you open the case, can you please send me its ID as a private message?

 

Thank you in advance.

Kind regards,

HP Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
Occasional Advisor
HenriqueAbreu
Posts: 11
Registered: ‎02-14-2014
Message 5 of 5 (423 Views)

Re: C Vuser - parsing failed even though systax is correct and script runs

Just to "close" this thread. I've opened a case with the support and they were able to reproduce the problem.

 

I've upgraded to LR12 and it does not happen there, so this issue is closed.

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.