Session can´t find childWindow(s)
See original GitHub issueHi,
i can´t find the child window of my windows application. I am using WPF. The windows are under the same processes and there is no splashing screen.
I´ve tried to transfer the solution of #99, but the WindowPopUpFinder throws an timeout error. I also gave back the window handles, but i just got 1 item, the application itself.
Here you can see the hierarchy. I am opening the mediaCollectionWindow with a MenuItem.
When I´m trying this:
// Open menu
WindowsElement menu = _mainWindow.FindElementByAccessibilityId(MAIN_WINDOW.MENU_VIDEO);
menu.Click();
// Open modal window via finder
WindowsElement openVideoWindow =
(WindowsElement)menu.FindElementByAccessibilityId(MAIN_WINDOW.MENU_ITEM_OPEN_VIDEO);
PopupWindowFinder finder = new PopupWindowFinder(_mainWindow);
Thread.Sleep(2000);
string videoWindowHandler = finder.Click(openVideoWindow);
// switch to window
WindowsDriver<WindowsElement> videoWindow =
(WindowsDriver<WindowsElement>)_mainWindow.SwitchTo().Window(videoWindowHandler);
i get the timeout answer as “User-Unhandled”-Exception.
Here i also got an timeout-exception:
// Open menu
WindowsElement menu =
_mainWindow.FindElementByAccessibilityId(MAIN_WINDOW.MENU_VIDEO);
menu.Click();
// Open modal window
menu.FindElementByAccessibilityId(MAIN_WINDOW.MENU_ITEM_OPEN_VIDEO).Click();
Thread.Sleep(2000);
// switch to window
WindowsDriver<WindowsElement> videoWindow =
(WindowsDriver<WindowsElement>)_mainWindow.SwitchTo().Window(MEDIA_COLLECTION.MEDIA_COLLECTION_WINDOW_TITLE);
And here i got just one item
ReadOnlyCollection<string> windowHandlesBefore = _mainWindow.WindowHandles;
// Open menu
WindowsElement menu = _mainWindow.FindElementByAccessibilityId(MAIN_WINDOW.MENU_VIDEO);
menu.Click();
// Open modal window
menu.FindElementByAccessibilityId(MAIN_WINDOW.MENU_ITEM_OPEN_VIDEO).Click();
Thread.Sleep(2000);
// Look for windows
ReadOnlyCollection<string> windowHandlesAfter = _mainWindow.WindowHandles;
And here is the result
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Maintaining the same Session in Child Window - php
When writing AJAX apps, I usually use window.location.host property to get the domain in JS so that I'm sure the XMLHttpRequest is made...
Read more >Getting the session from parent to child window in JSP - ...
The problem that am facing is, am not able to get the session object of the parent window in child window. It is...
Read more >How to maintain session in Both Parent window and child ...
I am using session concept in application. After login my application the Main screen screen is comming which we call parent window. Under...
Read more >How to handle multiple windows in Selenium
WebElement text = driver. findElement(By.id("sampleHeading")): Find the element and store in a web element through which we will get the text ...
Read more >Handling child window with parent session
Hi All, In my bsp application there is a child window with in parent.While i logoff from the parent window i want the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into similar problem in a .NET Core 3 WPF project. No splash screen.
WindowHandles
would only return the main window handle even after child windows were opened. The parent/owner was set correctly and I verified with inspect.exe that the new window was in fact a child.You can, however, interact with the child window elements through the
WindowsElement
API of the window itself. I was able to use this approach to open an ‘About’ window through a menu and then close it.I’m sorry, I can’t say for sure since I haven’t tried on Windows Server 2016. Which version of WinAppDriver are you using? I remember someone had a problem finding windows using desktop session in recent stable release(1.1). If you’re using the stable release, try using the pre-release version i.e. 1.1.1.