| || |
Functions in Functional Library always running in fast mode
I am utilising a functional library to hold lots of small chunks of code.
Within my UFT test I have run mode set to normal, delaying each step by 200ms.
When I run my test, the actions run with a 200ms delay.
However as soon as the test reaches a call to a function within a functional library the steps run in fast mode, and ignore any delay that has been set.
The application that I am testing renders the full page, however the cursor is not returned for a few milliseconds after.
If I run the test in fast mode, the test attempts to press buttons before the cursor is returned and therefore fails.
As the page is fully displayed I am unable to use sync points or waitproperty as the objects do exist.
I noticed that any functions that are held within the action i.e. not in a functional library run with a delay between steps.
1. Is there a way of applying the run mode setting to functions within a functional library?
2. If that is not possible, has anyone any suggestions how to get round this issue, I was thinking monitoring the status of the cursor, or importing the contents of the functional library into the action at run time, but i'm not sure if these are possible/viable.
Your page Sync statements are not 'holding' the exeuction until the page has fully loaded?
What's your Object Sync Timeout set to?
My main issue is that functions held within a function library are not ran with a delay between lines, even though run mode is set to normal (with 200ms delay). Really I'm looking for a better solution to adding wait statements between every line in the functional library.
Maybe something like this
Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Options.Run.RunMode = "Normal"
Set App = Nothing
Patience is like bread I say.... I ran out of that yesterday.
I have already tried that. If I return the value of Options.Run.RunMode I can see that the function knows the Run Mode and delay are set. However because of the way UFT has been designed, functions don't use that parameter.
I have managed to get a solution, buy overriding the default functions click, selectrow etc and adding a global wait statement to them.
Adding a Global wait....... Hmm, something doesn't sound right here. Is the AUT web based as I've never come across this issue and I have most of my code in func libs and just use QTP as a controller (expensive controller huh?)
The app is a Java Applet embedded within a browser, so it doesn't behave as a standard web app would.
Plus it has some lazy loading where forms are refreshed after closing windows within the app. Which is what causes some of the problems for UFT. As the object refreshes, it can remove things such as rows that are selected within tables etc.
The solution we have is to amend the standard object functions that UFT uses such as .click and amend them to perform a waitproperty on the object, prior to performing the obj.click. Basically the same as adding the waitproperty before every click in the script, but I hate that as it clutters up the script.
Its a java applet embedded within a browser.
The app uses some "lazy Loading" techniques to refresh objects, therefore it can take time for tables to refresh etc.
It results in issues such as if you run in fast mode, and select a row from a table, it occurs before the refresh, then the row is deselected.
Your method, with your "very expensive controller", is very much the route I am looking to take to move most functionality into functional libraries and away from native actions.
ah now I see, I did some automation on a content management system called Fatwire (now an Oracle product) and that was java objects embedded within FF browser. I remeber there were one or two objects within a particular frame where synchronisation proved impossible and I had to use a hard-coded wait which I wasn't happy about.
Is there anyway you could query a process resource usage like javaw to veryify when sync is complete?