I am newer to pywinauto, my company develop first windows application.I am using pywinauto to implement automated testing, but i encounter serious problems, it breaks me go further. my question is how to know methods of every object. for example as blow code form pywinauto official site
>>> from pywinauto import application
>>> app = application.Application.start("notepad.exe")
>>> app.Notepad.MenuSelect("File->SaveAs")
>>> dir(app.Notepad)
>>> app.SaveAs.ComboBox5.Select("UTF-8")
how i can konw app.Notepad has method MenuSelect() and app has method SaveAs? as you see the dir(app.Notepad) can know whose method.
Thanks in advanced!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would suggest two things…
a) look at the docs (hopefully not too far out of date)
b) run
>>> dir (app.Notepad.WrapperObject()))
The reason that app.Notepad doesn't return a useful list of methods is because it is an intermediate object. It is a WindowSpecification, it doesn't represent a window as such - but the specification of a window, and as such until you run HwndWrapper action on it - you are not sure which type of object it is.
Hope this helps,
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am newer to pywinauto, my company develop first windows application.I am using pywinauto to implement automated testing, but i encounter serious problems, it breaks me go further. my question is how to know methods of every object. for example as blow code form pywinauto official site
>>> from pywinauto import application
>>> app = application.Application.start("notepad.exe")
>>> app.Notepad.MenuSelect("File->SaveAs")
>>> dir(app.Notepad)
>>> app.SaveAs.ComboBox5.Select("UTF-8")
how i can konw app.Notepad has method MenuSelect() and app has method SaveAs? as you see the dir(app.Notepad) can know whose method.
Thanks in advanced!
Hi,
I would suggest two things…
a) look at the docs (hopefully not too far out of date)
b) run
>>> dir (app.Notepad.WrapperObject()))
The reason that app.Notepad doesn't return a useful list of methods is because it is an intermediate object. It is a WindowSpecification, it doesn't represent a window as such - but the specification of a window, and as such until you run HwndWrapper action on it - you are not sure which type of object it is.
Hope this helps,
Mark