Custom tree control and qtp - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Custom tree control and qtp (/Thread-Custom-tree-control-and-qtp) |
Custom tree control and qtp - Anil Kumar - 08-25-2009 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 RE: Custom tree control and qtp - basanth27 - 08-25-2009 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. RE: Custom tree control and qtp - Anil Kumar - 08-26-2009 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 RE: Custom tree control and qtp - basanth27 - 08-27-2009 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 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. RE: Custom tree control and qtp - Anil Kumar - 08-27-2009 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 RE: Custom tree control and qtp - basanth27 - 08-28-2009 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. |