I am currently working on a java based application in which I have an external functional library. Recently, I ran into a problem that I have not encountered before. The problem is that when I run the script it does not execute any of the function calls for functions that are in the library. It doesn't error or complain it simply skips the line. Even when I step thru the code which would normally allow me to step thru the function it doesn't. I have even removed the association within the script options and seen no change in the behavior of the script. I am very familiar with external function libraries as I use them on all my scripts which makes this all the more frustrating.
As a result of the time sensitive nature of the script I found a workaround by recreating the script using copy and paste. This however is not an ideal resolution. Therefore, I am very curious if anyone else has run into this problem and if they figured out what happened inside QTP that caused it or if anybody has any suggestions as to what happened. Otherwise, I fear that I will continually encounter this problem which I pray is based on human error, making it preventable. Any help would be greatly appreciated.
I've encountered this. Not in QTP but in a library file running through QTP (as well as in other scripted and compiled languages). I don't know what causes it. It could be a parser error since sometimes deleting one letter and retyping it gets it to work. As far as I'm aware this situation can only be resolved by replacing the section of code through to the entire file. Only saving grace is that these weird errors seem to be extremely rare.
I found that if I edit a lib referenced on a script with an external editor (like Notepad) that it often is thereafter seen by QTP to contain a single "0". But that throws and exception at runtime startup. To correct I have to open the file in the QTP editor, then the Notepad and paste the entire file from Notepad to the QTP editor: