Skip to content

Instantly share code, notes, and snippets.

@sf-shivang
Created November 29, 2019 13:15
Show Gist options
  • Save sf-shivang/ea701b54fb7fa6e8fa72ddf0d6fdcdb2 to your computer and use it in GitHub Desktop.
Save sf-shivang/ea701b54fb7fa6e8fa72ddf0d6fdcdb2 to your computer and use it in GitHub Desktop.
Automation python script for notepad testing, used pywinauto library.
from pywinauto.application import Application
app = Application().start("notepad.exe")
app.UntitledNotepad.Edit.type_keys("Hello people, this is sample automation testing python script for testing desktop application ie notepad. If you want to have fun just run this script on your desktop and have goosebumps.", with_spaces =True)
app.UntitledNotepad.menu_select("File->SaveAs")
app.SaveAs.exit1.set_text("Tst_pywinauto.txt")
app.SaveAs.Save.click()
app.Tst_pywinauto.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment