Monday, 24 April 2017

Locating an element to test with FlaUI

The WinForms application I'm trying to test is legacy in more ways than I'd like.

Here is FlaUI Inpect looking at a login form I want to test. I need access to 4 items. Each has an AutomationId. The ids are: textUser, textPINCode, buttonHalt, buttonLogin

These 4 controls are custom controls derived from Krypton controls. I think the Krypton controls derive from Windows Forms 2.0

Suppose I have a handle on the top level window ("FormSplashScreen"). What is the XPath to get one of the 4 I want (say textUser)?

1 comment:

  1. Using GetMainWindow seems to be very very unreliable (because Windows messes those up if there is a splash screen). Use app.GetAllTopLevelWindows(automation)[0] instead. Would be great if you could try that.

    ReplyDelete