1

I am automating a SWF Windows application using Winium. I have lots of SwfTreeView and TreeNodes items. I need to check/uncheck some tree node checkbox which I am unable to do.

I have tried clicking on the tree node but it is just selecting the node and not checking/unchecking the node.

Nickson
  • 15
  • 3

1 Answers1

0

I was having the same problem with my Tree View as well but I managed to make something work and hopefully this will help you :)

Tree Item Example

For this example, I have a tree item that needs to be checked in order for my program to proceed to the next stage otherwise it will throw an error "No Item has been selected".

First I find the actual element using FindElement and clicking on it to highlight it:

tcrForm.FindElement(By.Name("JG TF02 - 1 Defects Own Cycle")).Click();

Then by trial and error I moved the mouse coordinates manually using the Actions function. By moving and performing a click at the same time I managed to click the ToggleBox:

        Actions action = new Actions(driver); // Try and click the checkbox

        // From the centre of the element, move left, then click

        action.MoveByOffset(-117, 0).Click().Perform();
        Debug.WriteLine("Click has been performed");

I'm sure there is someone out there who has a better solution for this but as far as I know, this works fine. Please message me if it doesn't work for you.