I am working on an automation script(web), where I am trying to check if File upload window is already exist or not before I click on Browse button in my web app.
So in the code below I am getting the list of windows and killing it untill there are no more Open windows.
open_windows = pywinauto.findwindows.find_elements(title_re='Open')
if len(open_windows) >= 1:
for window in open_windows:
Application().connect(handle=window.handle).kill()
But this particular code is killing the parent window as well. While debugging, I can see only one open_windows and this code is able to identify that open window, however, it looks like the window.handle is same for both Open window and parent window, which causes this issue I believe.
I am working on an automation script(web), where I am trying to check if File upload window is already exist or not before I click on Browse button in my web app.
So in the code below I am getting the list of windows and killing it untill there are no more Open windows.
But this particular code is killing the parent window as well. While debugging, I can see only one open_windows and this code is able to identify that open window, however, it looks like the window.handle is same for both Open window and parent window, which causes this issue I believe.