Trying to select objects that Recorder ignores in my standalone app.
Newbie, apologies in advance...
I'm trying to select an object in my standalone application.
People give me examples like:
Set obj = CreateObject("Mercury.DeviceReplay")
But I am not testing Mercury, and I am not testing a webpage. I am testing our standalone application.
So can I do a CreateObject on our in-house application? How?
If I can't then is there some other way to right click on an object and then select a menu choice (either left click or Enter) on the resulting menu?
Thanks for any help.
(Background info: There are 100's of articles on how to right click a link. But I am not using a web app, and I have no problem with right-clicking. The problem is that when I rclick on an item, I get a menu. Then QTP ignores either left-clicking on that menu, or using Enter to select an item).
When you see references to Mercury in HP Products it is referring to Mercury Interactive. They were bought by HP.
What happens when you try recording on the application that you are trying to test?
response to response
I wasn't asking about Mercury...I'm asking how to CreateObject("MyApplication")
I know that if I am testing Excel, I do:
Set objExcel =Createobject("Excel.Application")
But how do I do, "Set objMyApp =Createobject("MyApp")? Again, it's standalone, so Createobject("IE") isn't going to help either.
Second, as I said, it records nothing when I left click. Specifically:
1. I Right click on my tree node while recording. I see QTP produce a line of code for 'rclick' and my menu opens up.
2. Then I left click on the menu, and QTP ignores me. It produces no code whatsoever.
This is my problem....I can not get QTP to right click on an item, then left click in the resulting menu.
The web only has examples of how to do this in browsers....I am trying to adapt those to my standalone app, but have failed so far.
When you do Set objExcel=Createobject("Excel.Application") you are actually not using QTP at all. That is a windows COM connection to the application. Your standalone app probably doesn't have that, but it may have an API if dev has exposed one.
QTP recording can not be relied on for anything beyond very basic scripts. Try examining the object with the object spy and write your own interactions.
For a standalone app, you may have to resort to using Sendkeys if native methods are not working.