05-16-2008, 02:16 PM
Hello,
I'm new to QTP and evaluating it with Infragistics TestAdvantage at the moment. I have an application with an Infragistics UltraTree which is found by QTP as SwfTreeView. The selection of the nodes in this tree works fine with the select method like this:
This method needs the text of the node to find it. As I can't exactly say what the Child2 nodes text will be (there might be some additional characters in front of "Child2") I wanted to use regular expressions to find the node, is that possible? The following code didn't work for me:
Is it even possible to use regular expressions in this case?
Is there another possibility to find a node in a tree by a regular expression? Or is it possible to loop through all nodes and compare their text to a given one?
I also tried to get a String with all the nodes using:
and then created a RegExp object to look for the pattern in this string but with no success.
In some thread I read about a check box in QTP to enable the regular expression usage but I can't find it in the qtp application. Do I have to enable it before it works correctly? I'm a bit puzzled about that now.
Any hints about that appreciated.
Regards
Simone
I'm new to QTP and evaluating it with Infragistics TestAdvantage at the moment. I have an application with an Infragistics UltraTree which is found by QTP as SwfTreeView. The selection of the nodes in this tree works fine with the select method like this:
Code:
SwfWindow("MyApp").SwfTreeView("myTree").Expand "\Root\Child1\Child2"
This method needs the text of the node to find it. As I can't exactly say what the Child2 nodes text will be (there might be some additional characters in front of "Child2") I wanted to use regular expressions to find the node, is that possible? The following code didn't work for me:
Code:
SwfWindow("MyApp").SwfTreeView("myTree").Expand"\Root\Child1\*Child2"
Is it even possible to use regular expressions in this case?
Is there another possibility to find a node in a tree by a regular expression? Or is it possible to loop through all nodes and compare their text to a given one?
I also tried to get a String with all the nodes using:
Code:
SwfWindow("MyApp").SwfTreeView("myTree").GetContent
and then created a RegExp object to look for the pattern in this string but with no success.
In some thread I read about a check box in QTP to enable the regular expression usage but I can't find it in the qtp application. Do I have to enable it before it works correctly? I'm a bit puzzled about that now.
Any hints about that appreciated.
Regards
Simone