Python Pywinauto how to validate if a UI element exists using Pywinauto for Desktop application

Hello Friends I am new to PywinAuto looking for some quick Guidence how can we validate if a UI element Exists , for example if a Test looks for specific Ui element existance we should be able to validate it , it can be anything which appears on the page of AUT. if a dot(.) also should be validated ,how to ? or a Buttons existance should be validated . please help on this

Upvotes: 2

Views: 3784

Answers (1)

Vasily Ryabov
Vasily Ryabov

Reputation: 9991

The first problem should be solved by something like this:

app.window(title="Main Window").child_window(title="OK", control_type="Button").exists(timeout=2)

Did you read the Getting Started Guide and Waiting for Long Operations? They describe all core concepts of pywinauto you need to know for the vast majority of cases.

Upvotes: 4

Related Questions