Coded UI Tests

I have recently been looking into coded UI tests, and was hoping to implement them for our diagramming software (using GoXam Certain behaviors are recorded and repeatable (ie. dragging nodes from the toolbox to the diagram), but most others don’t seem to be (ie. drawing links).

Is there anything I might be missing to get this working? Or is this something that would need to be built into the diagram control?


Do you know what the problem is? My guess would be that due to layout and scrolling animation, things are not where you would expect them to be until the animation is complete. So you could try turning those off to see if the tests become more repeatable.

Here is a picture of the result of the actions I recorded:

When I replay the recorded action it drags the object onto the diagram, but when it goes to draw the link it moves the mouse to the tab at the top and doesn’t do anything.

This is the code generated:

Mouse.StartDragging(uIExpander, new Point(34, 136));
Mouse.StopDragging(uIDiagram1TabPage, new Point(195, 207));

// Click 'Diagram 1' tab
Mouse.Click(uIDiagram1TabPage, new Point(465, 366));

// Click 'Diagram 1' tab
Mouse.Click(uIDiagram1TabPage, new Point(467, 152));

For whatever reason it is recording the link drawing (a click and drag) as 2 clicks?

If you remove the TabControl containing the Diagram, does it record better?

You may need to change the styling of the TabControl:

Moving the diagram outside of the tab control does make it work better… I used the sample app and was able to create a recording of adding 2 objects and drawing a link between (though it was a bit finicky getting it to the right spot).

After getting that going I was running into another issue - trying to add assertions with the test builder won’t highlight anything below the piping control - so I can’t add assertions for the visuals on the objects.

Just a quick follow-up to see if you’ve been able to add assertions for objects on your end? Is this something that should be doable?

We have our own test system, from long before any other test systems were available. So we are unfamiliar with Coded UI and therefore can’t help you there.

Hi Walter, what is meant by ‘We have our own test system, from long before any other test systems were available’. Can you please introduce that test system?

I’m not sure what I can say. There weren’t any other test systems available for WPF and Silverlight, so we wrote our own test framework.

You might find it useful to call DiagramPanel.PerformGesture.