thebrowsercompany / swift-webdriver

A Swift library for communicating with WebDriver (Appium/WinAppDriver) endpoints
BSD 3-Clause "New" or "Revised" License
105 stars 3 forks source link

Don't start WinAppDriver if process already running #22

Closed christianfo closed 1 year ago

christianfo commented 1 year ago

This change is a different take on WIN-585 than PR https://github.com/thebrowsercompany/webdriver-swift/pull/20 to work around the crash in URLSession.shared.dataTask when the endpoint does not exist (Linear issue# ?)

Instead of calling the endpoint, we first checks if the WinAppDriver process is running on the machine, and only start it if not. This allows us to transparently launch the server on local machines from the swift code, but launch it from the GitHub actions on the CI, as we are finding issues with launching a process on the GitHub machines (Linear issue?)

This change also brings a couple Windows process/hwnd helper functions together in WindowsUtilities.swift.

WIN-585