Repository: microsoft/WinAppDriver

Issue #1599: OpenQA.Selenium.WebDriverException: Currently selected window has been closed
Created: 2021-09-24T08:49:56Z
Hii,
I am running UI testing testcases for UWP(C#) application.It is working fine on my local machine,when i tried to run on ms hosted agent,most testcases are failing with error like Currently selected windows has closed.I have verified,i am prroviding same configuration for ms hosted agent like local machine.
I request your kind help in this regard.
Thank you in advance.

Duplicate issue #1804: winapp or appium issue when NoSuchWindowException: Message: Currently selected window has been closed
Created: 2022-10-12T01:39:03Z
I am using robotframework to automate desktop app and hitting this error randomly.
is this winapp or appium related problem:

    TEST TC001-About-Version
Full Name:  Test-001-About.TC001-About-Version
Start / End / Elapsed:  20221012 09:23:39.213 / 20221012 09:23:44.194 / 00:00:04.981
Status: FAIL
Message:    Setup failed:
NoSuchWindowException: Message: Currently selected window has been closed


Also teardown failed:
Several failures occurred:

1) NoSuchWindowException: Message: Currently selected window has been closed


2) NoSuchWindowException: Message: Currently selected window has been closed
00:00:04.954SETUP Keywords . Test Setup About
Start / End / Elapsed:  20221012 09:23:39.213 / 20221012 09:23:44.167 / 00:00:04.954
00:00:00.004KEYWORD Keywords . Start Simulator
Start / End / Elapsed:  20221012 09:23:39.214 / 20221012 09:23:39.218 / 00:00:00.004
00:00:00.003KEYWORD Process . Start Process ${Simulator}, alias=Simulator
Documentation:  
Starts a new process on background.

Start / End / Elapsed:  20221012 09:23:39.214 / 20221012 09:23:39.217 / 00:00:00.003
09:23:39.214    INFO    Starting process:
"C:\Program Files\TESTAPP\Simulator\Simulator.exe"  
00:00:02.967KEYWORD Keywords . Start App
Start / End / Elapsed:  20221012 09:23:39.218 / 20221012 09:23:42.185 / 00:00:02.967
00:00:00.004KEYWORD ApplicationLibrary.DesktopLibrary . Driver Setup ${WinAppDriver}
Documentation:  
Starts the WinAppDriver.

Start / End / Elapsed:  20221012 09:23:39.218 / 20221012 09:23:39.222 / 00:00:00.004
00:00:02.963KEYWORD ApplicationLibrary.DesktopLibrary . Open Application ${REMOTE_URL}, alias=TESTAPP, platformName=Window, deviceName=Windows, app=${APP}, splash_delay=20
Documentation:  
Opens a new application to given Appium server. If your application has a splash screen please supply the window name of the final window that will appear. For the capabilities of appium server and Windows please check http://appium.io/docs/en/drivers/windows

Start / End / Elapsed:  20221012 09:23:39.222 / 20221012 09:23:42.185 / 00:00:02.963
09:23:42.185    INFO    A
B   
00:00:01.981KEYWORD Keywords . Health Check
Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:44.166 / 00:00:01.981
00:00:00.000KEYWORD ApplicationLibrary.DesktopLibrary . Switch Application TESTAPP
Documentation:  
Switches the active application by index or alias.


Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:42.185 / 00:00:00.000
00:00:01.981KEYWORD ApplicationLibrary.DesktopLibrary . Wait Until Page Contains Element ${txt_system_status}, timeout=10s
Documentation:
Waits until element specified with locator appears on current page.
Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:44.166 / 00:00:01.981
00:00:00.007KEYWORD ApplicationLibrary.DesktopLibrary . Save Appium Screenshot
Documentation:
Takes a screenshot with a unique filename to be stored in Robot Framework compiled reports.
Start / End / Elapsed:  20221012 09:23:44.157 / 20221012 09:23:44.164 / 00:00:00.007
09:23:44.162    FAIL    NoSuchWindowException: Message: Currently selected window has been closed
09:23:44.165    WARN    Keyword 'Save Appium Screenshot' could not be run on failure: NoSuchWindowException: Message: Currently selected window has been closed
09:23:44.165    FAIL    NoSuchWindowException: Message: Currently selected window has been closed
00:00:00.027TEARDOWN Keywords . Test Teardown About

Closing comment (2022-11-19T18:53:45Z): Possible duplicate of #1599