pylearner February 2016

pywinauto:saving text to a variable

I am automating a windows application using pywinauto. Thanks to Stack Overflow for helping me all the way.

My problem statement goes like this: After a successful run of the code for 10 times (say), I get a success message 10 times which should be captured and placed in excel sheet for each run (using, openpyxl). So I would like to capture the text into an array element.

Is there a way to copy a text to a variable element in pywinauto?

Answers


Vasily Ryabov February 2016

Uneditable form means disabled edit box / read-only text label or non-detectable control without native handle?

  1. For disabled edit box or text label you can get text by using something like that: app.WindowName.EditBox.WindowText(). Of course, EditBox is a correct access name that can be found in app.WindowName.PrintControlIdentifiers() method output.

  2. For the non-detectable control you are not able to copy text. Probably future pywinauto 0.6.0 release may help you.

Post Status

Asked in February 2016
Viewed 3,396 times
Voted 10
Answered 1 times

Search




Leave an answer