I'm using the code below at the start of all our scripts to launch the application we want to test. I also have the settings set to only record on applications opened by QTP. We are finding that our Object repository is not always stable. sometimes QTP recognises an object as a winObject sometimes activeX and other discrepencies.
I just wanted to check if everyone else is launching there applications in a similar way or know of any other best practises. I've heard the term 'Automation Object Model' mentioned. Should I be looking at this to try and get some consistancy
AOM does not help much in object identification stuff, except that the tool settings and options can be made sure to be consistent across machines and different instances, if the QTP is launched using a AOM script. It gives you other features to work easily with the tool.
Check if an instance of application is already running before QTP is launched. QTP should be the first process launched as compared to the application.
'InvokeApplication' method is another way of launching applications thru QTP.