【发布时间】:2022-06-16 00:51:37
【问题描述】:
我正在编写一个通过测试完成和 C# 访问 JTree 的测试。我附上了一张图片。不幸的是,为了公司机密,我不得不把一些文字涂黑。但基本上是这样的:
路由规则
- 2 级分支
- 3 级选择
我将 JTree 放入 C# var(称之为“树”)。我可以通过这样做轻松展开和折叠
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
效果很好。但是当我试图确定某些东西是否被扩展时,就像这样
var expanded = tree["wExpanded"]("Routing Rules");
这给出了一个例外
-
_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}
这似乎是这个网站所说的:
我做错了吗?或者我可以不将值分配给“var”并且必须在 if() 语句中使用它吗?
【问题讨论】:
标签: c# jtree testcomplete