Switching between different applications

Hello, I wonder, is it possible to switch between many different Windows Applications during TestCase Execution? Or it is just possible to switch between different windows of the application I already started with WindowsDriver? Because I have one desktop app, that only opens through Browser Plugin, so I can’t instruct Katalon Studio to open it using exe file. It just need to find it once it’s already open. I am having so much trouble doing this, so any help would be appreciated.
Also, I just tried to switch to already opened but minimized PowerShell Window and It waited few minutes and then it said it was successful, but PowerShell still stayed closed. So is it possible to only create a test for 1 concrete application chosen at the beginning, and then do some actions on it, or is it possible to do switch apps freely?
Thanks so much!!!

I am also looking for the answer, buddy.

hi @peter.hevesi @rasis.o13

yes, you can attach to a window that is already open, you just do not go through the exe. winappdriver has a desktop session: start it on the root and then every top level window on the machine is reachable.

Windows.startApplication('Root')
Windows.switchToWindowTitle('Title of the app the plugin opened')
Windows.click(findWindowsObject('App/button_ok'))
Windows.switchToWindowTitle('Another App')

startApplication(‘Root’) does not launch anything, it gives you a session that spans the whole desktop. switchToWindowTitle then moves the driver to the matching window, and you can jump back and forth between any number of apps in the same test case. object spy also works on the root session, pick “Root” as the application and spy whatever is on screen.

one thing to watch: on the root session xpath locators are evaluated against the entire desktop, so keep them scoped, start them from the window (//Window[@Name=‘…’]//Button[@Name=‘OK’]) or the spy will be slow.

I am adding few more points to the Depa’s post ( which is already covering everything)

    1. Simply switching to a driver does not automatically restore or bring a window into focus. This is likely why the minimized PowerShell window appeared to switch successfully but remained minimized. In such cases, restore the window first (for example, by clicking its taskbar icon through the Root session) before performing any interactions. I have noticed in my prior projects
  1. When an application is launched through a browser plugin, its window may not be available immediately. Instead of relying on a single switch attempt, consider implementing a short retry mechanism with a 1-second interval for up to 15 seconds to allow the window sufficient time to appear.
  1. If the application window title changes dynamically or contains variable text, avoid using an exact title match. A more reliable approach is to locate it using a partial match like contains(@Name,‘…’)
  1. If the target application is running with elevated (Administrator) privileges, ensure that WinAppDriver is also started as Administrator. Otherwise, those elevated application windows may not be visible within the Root session, preventing them from being located or interacted with

Some of the above posted small adjustments often help make desktop window switching and application handling much more reliable.