| || |
I have a Library Functions file which I share across many tests. On occasion a test won't run a function from this file. There isn't anything wrong with the function since it works in other tests. It is really quite baffling. Has anyone else come across this issue or have any idea what the cause is?
I'm using QTP 9.5.
Re: Function issue
Do all tests have this FL associated? The first test to be loaded will provide the libraries that are loaded. (This means if Test A calls Test B, then only Test A's function libraries are available to Test B. If they're the same libraries, great - otherwise, this can cause issues). This is only an issue if you have a driver test calling other tests.
If you are only dealing with one running test....I'm not sure what could cause a 'loaded library' to become 'unloaded' - unless you unload it prior to launching your test via a driver script.
Other things to check
- Do you have a RecoveryScenario that points to a function in that function library? I've had the issue where it loads the library twice, and causes issues when things are DIMed more than once. The fix was the separate RS libraries into their own qfl/vbs files.
- If you find the library is consistently not loaded, you can actually use ExecuteFile("filename") (via QTP folders) to manually load a library into scope. This screws VBScript debugging, however, as QTP won't know where in the file an error occurred; reporter actions will still work.
Let me know if you figure it out