You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TestStack.White TreeNode.Click() and TreeNode.Select() for leaf node does not work #672
I have a WPF window containing a TreeView. I am able to automate traversing the tree and can successfully select or click (either one) nodes with children, but it doesn't work for leaf nodes.
Finally, TreeNode.Click() and TreeNode.Select() do not work to completely traverse a Tree:
The only method that PARTIALLY works is: Mouse.Instance.Location = node.ClickablePoint; Mouse.Instance.Click();
However, I discovered that this method doesn't work to click ALL child nodes of a node because TestStack.White clicks outside of the TreeNode header except for the child node that is widest.
Activity
jeffhuckins commentedon Oct 7, 2022
Update: I've discovered an issue with TestStack.White for TreeNodes
First of all, the Tree.node() method has never worked for our testing. It was necessary to implement our own traversal code:
` private TreeNode FindNode(TreeNode node, string sVal, bool bExpandNode)
{
LogEntry.Debug(log, "Entering");
TreeNode result = null;
`
I also had to create a static wrapper class in order to wrap calls to TreeNode action methods in try/catch due to erroneous Exceptions being thrown:
`namespace FormFactor.WinCal.Utilities
{
///
/// Robust TreeNode
///
internal static class FfiTreeNode
{
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
}
`
Finally, TreeNode.Click() and TreeNode.Select() do not work to completely traverse a Tree:
The only method that PARTIALLY works is:
Mouse.Instance.Location = node.ClickablePoint; Mouse.Instance.Click();However, I discovered that this method doesn't work to click ALL child nodes of a node because TestStack.White clicks outside of the TreeNode header except for the child node that is widest.