1

My Application Framework: C#.Net

.

Target Application Framework: Qt

.

My automation tools:

  • TestStack/White
  • Useful classes of System.Windows.Automation namespace

I have a Qt application and i got one of its panels (dialer panel) by following codes BUT I can't get (find) any children element of it!

.............enter image description here

.


Main part of my codes:

var dialerWindow = mainWindow.Get<TestStack.White.UIItems.Panel>("DialerPageWindow");

TreeWalker walker = TreeWalker.RawViewWalker;

AutomationElement current = walker.GetFirstChild(dialerWindow.AutomationElement);

//Now current is NULL :(

.


I watched dialerWindow variable (DialerPageWindow) in VS. It's snapshot: enter image description here

.


I read this answer to a question by this title: Windows UI Automation not showing all child elements?

But

  • I nead a way to send a click event to this button.
  • Please suggest any tools, library, third party library, windows message or... in C# to solve this problem
Community
  • 1
  • 1
Ramin Bateni
  • 16,499
  • 9
  • 69
  • 98

2 Answers2

1

From your screenshot it looks like the elements in the dialer window are nog exposed to UIAutomation. Have you tried using inspect or winspector or any other spytool to see if the element is detectable?

If they are not detectable, then there are 2 options

  1. You have access to the sources and implement a provider that exposes the element (see this) You are probably looking for IRawElementProvider
  2. You are bound to clicking coordinates (sorry)

If you have access to the code, see this GitHub repo on how to implement.

Rik
  • 3,647
  • 2
  • 25
  • 34
0

As a pyhtonist I can suggest pytest-qt plugin for pytest framework that may be useful for QT applications.

Vasily Ryabov
  • 9,386
  • 6
  • 25
  • 78
  • my application framework is `.NET`. Is your suggested plugin about `C#.Net` or `Python`?!!! – Ramin Bateni Nov 02 '14 at 14:23
  • Yes, how about Python scripts? ;) – Vasily Ryabov Nov 04 '14 at 18:51
  • I've just started checking this approach for Python. Installed pytest (OK), failed to install pytest-qt (reverted back because PySide is required), failed to install PySide (need more investigation). So getting started with that looks not friendly. Sorry. Probably someone could suggest you any approach for C#. – Vasily Ryabov Nov 05 '14 at 05:48