Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom tree control and qtp
#1
Not Solved
Hi,
I am trying to automate a window which uses a custom tree control(by Bennet-Tec Information Systems, Inc) in a VB application. QTP sees the objects as WinObject("AfxOleControl42") - and there seems to be no other property that I can use other then x and y coordinates.
recording shows:
Code:
VbWindow("VbWindow").WinObject("AfxOleControl42").Click 37,23

I contacted HP to get help but they said QTP does not support custom controls.
It seems like that you can call methods in a DLL using EXTERN.DECLARE. Will this work with *.OCX that Bennet provides? Any help would be greatly appreciated.

Thanks in advance,
Anil
Reply
#2
Not Solved
Anil -
What do you want to automate on the tree structure ?

what you see as winobject is definitely a custom object. There are different ways to work with a custom object. You can use the virtual object feature in QTP to see if that helps.

A screenshot of the tree and the spy of the tree will help a lot to understand better.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Hi,
Thanks for the response.
I am attaching the "window" that I am testing and also the "object spy" result. What I need to do is to identify "stuff" in the window and based on what I find, I need to do something with it(without getting into details about the application). The content in the window you see is dynamic.
Example of "stuff" I need to do:
Find "FOB"(see the "window.jpeg") right click on it and choose something from the menu.
Does that help? Please let me know if you need any more information.
Thanks again,
Anil


Attached Files Image(s)
                   
Reply
#4
Not Solved
Anil -

Okay. It doesnt seem easier than i thought.

1 . What technology is used to build that Tree ?

There are 2 ways to approach this issue,

1. IF you know the technology then you can discuss with HP to know if there are any supported add-ins which can help you recognize the object.
2. Reinvent the wheel. It means you may have to write your own customized functions to work with this object. Let me give you a clue,

Code:
.WinObject().GetTextLocation ' Does this method exist ? If not check what other methods would give you the text from the tree. This will give you the co-ordinates of the text

Then you can try the below,

Set DeviceReplay = CreateObject("Mercury.DeviceReplay")
DeviceReplay.MouseClick x, y , RIGHT_MOUSE_BUTTON
Set DeviceReplay = Nothing

The second approach is going to be a tedious and would require a lot of research from your end, sometimes working closely with the developement team.

Try the first approach to your best and if you dont succed then plan your second approach.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Not Solved
Hi,
Thanks for response. HP just simply said that they do not support 3rd party custom control - wouldn't even offer me any suggestions :--). I looked up your suggestion of using "GetTextLocation" - seems like they no longer support it and is marked as "obsolete". I did not see any other similar function.
Looks like I won't be able to do any verification - just dumb record and play back using coordinates - that seems to work ok.
Do you know if I can use EXTERN.DECLARE to run methods in a *.ocx?
I can't seem to find any information on that. I have seen examples where they call method in a *.dll but not an *.ocx.

Thanks again,
Anil
Reply
#6
Not Solved
Anil -
Extern.Declare is specific to loading DLL's only. Know more about it Loading DLL

I dont think that .OCX can be loaded and you can utlize the methods. But again, this is my opinion and i am not very sure about it.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Windows Application Custom Combo box selection change event not firing in uft RamUFT 0 824 02-06-2020, 08:10 AM
Last Post: RamUFT
  Custom sort -Excel Sheet kiran 1 3,683 01-28-2014, 09:23 AM
Last Post: supputuri
Exclamation How to get values from a Java Tree Narayanan 0 3,811 11-28-2013, 03:31 PM
Last Post: Narayanan
  How to expand and collapse a tree structure in a web page qtplearner88 4 8,163 04-05-2012, 09:14 AM
Last Post: qtplearner88
  Bitmap Custom Comparer veera.koduri 1 3,098 06-28-2010, 03:30 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)