VirginiaSus3
3 years agoOccasional Contributor
Using JTree with C# and Test Complete
I am writing a test which accesses a JTree via test complete and C#. I have attached an image. Unfortunately, for company confidentiality I had to black out some of the text. But it is basically the following: FMC 4 ME
Routing Rules
- Level 2 branches
- level 3 selections
I get the JTree into a C# var (call it "tree"). I can easily expand and collapse by doing
tree["DblClickItem"]("Routing Rules"); // expand/collapse top branch tree["DblClickItem"]("Routing Rules|Level 2 branches"); // expand/collapse second-level tree["ClickItem"]("Routing Rules|Level 2 branches|level 3 selections") // select item
that works fine. But when I try to determine whether something is expanded or not, like this
var expanded = tree["wExpanded"]("Routing Rules");
this gives an exception
_innerException {"Unable to find the object wExpanded(\"Routing Rules\"). See Details for additional information.\r\n<html><body><p>The object with the specified attributes does not exist.</p><p style=\"margin-top: 12px;\"><a href=\"aqa-help://2202\">Possible causes of the error</a></p></body></html>"} System.Exception {System.Runtime.InteropServices.COMException}
this appears to be how this web site says to do it:
Am I doing something wrong? Or can I not assign the value to a "var" and must use it in an if() statement?