Hello,
i got a prolem. I am using QuickTest 10 an try to identify a TreeView (out of three) in my Window.
The "swfhandle" changes with every new window.
Current "swfhandle" -> "ObjectExplorerHostPage.ObjectExplorerHostPage_25ec0e8f-ff58-4108-9978-b99b69dd6816.Tree.ExtendedTree"
I tried to delete the number an using (.*) instead in combination with regular expression. That works in some windows without other TreeViews. But he can't locate it anymore with more than one TreeView in the Window.
The Windows-Handle "hwnd" changes too..
So what can i do now? There is no "Parent"-TreeView. I just have three TreeViews and want to make the identification of them unique.
I hope someone can help me :]
Hi,
I am not entirely sure where to start. I haven't actually even seen the property swfhandle. I am assuming by the "swf" prefix, I am assuming it's for windows forms controls. If I am wrong, what platform are you attempting to record against? Also what is the type name of the control that you are trying to record against.
That aside, if you are using the hwnd, while the name is going to be unique, it is intended to be unique per instance, not a repeatedly unique name. What that generally means, is when the window is created, a new unique identifier is created each time, and that identifier is not going to be the same as it was created the previous time you opened it. What you need for QTP to work is an identified that is unique but repeatedly so. In most cases for windows forms the control name is used, because the control name needs to be unique for the window it's on. The form name is usually used as well, but unlike the control it is possible to have more than one form open with the same name, and you need to be wary of that and try to limit opening multiple copies of the same window. Either that or work with your developer to have the windows name with more unique names based on function and context. Such as if you open a dialog window when you select a row in a grid. Name the form of the dialog based on the function of the dialog, and the identifier of the row. That will make it repeatedly unique.
Hope that helps,
you are right, i am using windows forms. Your second passage describes my problem. The object Spy can't find any usefull 'Identification Properties'.
(swf)typename: 'Infragistics.Win.UltraWinTree.UltraTree'.
(swf)Name: 'ObjectExplorerHostPage.ObjectExplorerHostPage_959ffe40-0e01-4fb1-b2eb-0c508d92a155.Tree.ExtendedTree'
nativeclass: 'WindowsForms10.Window.8.app.0.3cb1bf5'
The 'swfname path' is very long and has the same (cryptic) numbers which changes every new window.
Through the .Net-ObjectSpy i can find the Name of the Node i wan't to click. But if two or more TreeViews have the same Node-Name like "Help" or "Print" i am back at the main problem. :(
The group of cryptic numbers and letters looks to be a GUID(Globally Unique Identifier), is a special type of identifier used to provide a unique reference number. Not sure why it's in the control name, but my thought is your developer is creating the controls completely on the fly and setting the name property of the controls with a GUID built in so that it will never repeat.
Tree Nodes are not controls, they are internal objects to the Tree Control. QTP's object spy only identifies controls, not objects like TreeNodes. That being said, as to duplicate Node Text, they would need to have identical text on the with the same parent tree. Which is possible, shouldn't happen often, and if need be, your developer can assign a key to the Node and you can use that instead.