Unable to Switch control between multiple windows of a Windows Application
Hi , i am trying to automate a windows application, while doing so i faced an issue the scenario was :
- The application has a button , clicking on it will open a new window.
- I want to perform some actions on the window but when i tried to move my control to the new window by Using :
Set
windowHandles = driver.getWindowHanldes(); windowHanldes.switchTo.window(); the set only had one window in it.
I also Tried using PopUpWindowFinder but was not able to use the class maybe because it is not supported for Java.
Can you please tell me how can i switch my driver focus to other window?
@angad16 I use workaround to attach to new window by process name or window name https://github.com/microsoft/WinAppDriver/issues/534#issuecomment-562030077 Then attach to previous window with the same code.
But this is c# code :(
If the switchTo() method is not working, try calling the Click() method on the other window. I've worked with an Excel Ad In where all Ad-in popups were parented by the Desktop and I found them using a "Root" session. You may try that as well.
Thanks @naeemakram i was able to switch controls by creating new Desktop Session as mentioned in below issue. Do we have possibility switch between apps during test executions? #445
I believe yes, we can create multiple instances of WindowsDriver