0

Trying Python + Python Appium Library + WinAppDriver to perform a simple automation task:

  1. Launch Notepad
  2. Enter some text.
  3. Close Notepad without saving

When I close notepad using self.driver.close_app() call, it doesn't close it, since there is unsaved text in the notepad window. How can I perform this task without it prompting me to close the Window OR do I need to automate clicking on Don't Save button which will close the app?

Al Imran
  • 882
  • 7
  • 29
utpal
  • 331
  • 5
  • 13

2 Answers2

0

You can try self.driver.quit()

OR

Automate the Don't save button.

Wasiq Bhamla
  • 949
  • 1
  • 7
  • 12
0

I'm not familiar with WinAppDriver, but did you try to send it key command for closing Notepad, something like:

self.driver.find_element().SendKeys(Keys.Alt + Keys.F4)

There is something in here with WinAppDriver that might help if above doesn't https://github.com/Microsoft/WinAppDriver/blob/master/Tests/WebDriverAPI/SendKeys.cs.

Mate Ajdukovic
  • 340
  • 3
  • 17