microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.4k forks source link

WinAppDriver not supporting to switch to Alert #678

Open umadevisk89 opened 5 years ago

umadevisk89 commented 5 years ago

========================================== GET /session/D083E1CC-017A-4D84-A8A6-77F3D36DC5C1/alert_text HTTP/1.1 Accept: application/json Accept-Encoding: identity Content-Type: application/json;charset=UTF-8 Host: 127.0.0.1:4723 User-Agent: selenium/3.141.0 (python windows)

WinAppDriver::CommandHandler::Session::HandleCommandAsMidPoint - Command alert_text is not recognized

HTTP/1.1 404 Not Found Content-Length: 146 Content-Type: application/json

{"status":9,"value":{"error":"unknown command","message":"Command not recognized: GET: /session/D083E1CC-017A-4D84-A8A6-77F3D36DC5C1/alert_text"}}

On trying to switch to Alert in a WPF application above error is thorwn. Please provide fix for it.

Thanks in Advance.

MissingPiece commented 5 years ago

can you post the code how you are trying to switch to the Alert prompt?

umadevisk89 commented 5 years ago

I have used below packages:

from selenium.webdriver.common.alert import Alert from selenium.webdriver.remote.switch_to import SwitchTo

Usuage:

alert =self.winAppdriver.switch_to.alert alert.accept()

I am trying to switch to alert in my WPF application.

Please let me know if this is correct.

Thanks, Uma

umadevisk89 commented 5 years ago

Any update on this help.

Thanks