Skip to content

feat(windows): add WincoreDriver and screen recording options - #1159

Merged
KazuCocoa merged 6 commits into
appium:mainfrom
hoanle0126:feat/wincore-driver-1154
Nov 26, 2026
Merged

KazuCocoa merged 6 commits into
appium:mainfrom
hoanle0126:feat/wincore-driver-1154

Conversation

@hoanle0126

@hoanle0126 hoanle0126 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Closes #1154

List of changes

  • Add AutomationName.Wincore ("Wincore") and WincoreDriver under OpenQA.Selenium.Appium.Windows, defaulting PlatformName and AutomationName only when unset.
  • Mark AppiumDriver screen recording methods virtual and override them in WincoreDriver to call windows: startRecordingScreen and windows: stopRecordingScreen.
  • Add WincoreStartScreenRecordingOptions (outputPath, videoFps, captureCursor, captureClicks, audioInput, videoFilter, preset, timeLimit, forceRestart) and WincoreStopScreenRecordingOptions.
  • Initialize ScreenRecordingUploadOptions.Parameters, fixing a NullReferenceException that already occurs on main.
  • Support LaunchApp(), CloseApp(), PullFile, PushFile, and WebView Context/Contexts, throwing NotSupportedException on PullFolder.
  • Mark WindowsDriver as obsolete in favor of WincoreDriver, with CS0618 suppressed in the legacy Windows integration tests.
  • Add unit tests in WincoreDriverTests.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change that adds functionality or value)
  • Refactoring (non-breaking change that improves code without altering functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New test coverage (non-breaking change that adds tests for existing, previously untested functionality)
  • Test fix (non-breaking change that improves test stability or correctness)
  • Chore/Maintenance (updates to build scripts, dependencies, or GitHub Actions)

Tests

  • Unit tests
  • Integration tests
  • No automated tests (explain why below)

How they run: Picked up by the Tests.Driver filter in unit-test.yml.

Documentation

  • Have you proposed a file change/PR with Appium to update documentation?
  • Not applicable (updated README.md in this repository)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unsupported keyboard APIs, failing upload-option construction, and platform defaulting that overwrites explicit values remain unresolved.

3 open issues
What changed in this PR

Adds first-class Wincore support to the Appium .NET client for Windows automation, addressing #1154 and deprecating the legacy WindowsDriver.

Changes:

  • Adds WincoreDriver, its automation name, app-management commands, and inherited context, file, and settings support.
  • Adds Wincore screen-recording options and null-safe handling of recording responses.
  • Adds server-free command tests and updates Windows setup guidance.
File Description
test/​integration/​Driver/​WincoreDriverTests.cs Tests defaults, recording options, and command requests.
src/​Appium.Net/​Appium/​Windows/​WindowsDriver.cs Marks the legacy driver obsolete.
src/​Appium.Net/​Appium/​Windows/​WincoreStopScreenRecordingOptions.cs Adds Wincore recording-stop options.
src/​Appium.Net/​Appium/​Windows/​WincoreStartScreenRecordingOptions.cs Adds Wincore recording configuration.
src/​Appium.Net/​Appium/​Windows/​WincoreDriver.cs Introduces the Wincore driver and command wrappers.
src/​Appium.Net/​Appium/​Enums/​AutomationName.cs Adds the Wincore automation identifier.
src/​Appium.Net/​Appium/​AppiumDriver.cs Enables overrides and handles null recording responses.
README.md Recommends Wincore for Windows automation.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

CI status remains unverified, and repository guidance requires confirmed passing checks before approval.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Fix documented Wincore driver installation command

README.md:113

The documented appium driver install wincore command fails because wincore is not in Appium's KNOWN_DRIVERS registry; short-name installation rejects unrecognized names. Use appium driver install --source=npm appium-wincore-driver, as documented in the linked driver's README, so users can install the server-side driver required by WincoreDriver.

3 resolved since last review

Review effort: Balanced

@hoanle0126
hoanle0126 force-pushed the feat/wincore-driver-1154 branch from 2de9503 to 8eb42b9 Compare November 5, 2026 03:44
@hoanle0126

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main now that #1160 is merged and added WincoreDriver_ExecutesCommandsOverMockAppiumServerHttp covering WincoreDriver commands (LaunchApp, CloseApp, StartRecordingScreen, and StopRecordingScreen with upload options) against MockAppiumServer.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Wincore support changes.

No open issues 🎉

Review effort: Balanced

@Dor-bl Dor-bl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, the structure lines up well with the Java client's WincoreDriver. A few things before it can merge:

Blocking

  1. Screen recording won't reach Wincore. StartRecordingScreen/StopRecordingScreen POST to /appium/start_recording_screen and /appium/stop_recording_screen. Appium 3 moved those routes into the individual drivers. Wincore doesn't register them and only exposes windows: startRecordingScreen / windows: stopRecordingScreen (its own e2e tests use those). Suggest making the base recording overloads virtual and overriding them in WincoreDriver to call ExecuteScript("windows: …", options.GetParameters()).
  2. Start options: Wincore's start command ignores upload options (only stop uploads) and defaults forceRestart to true. Please drop the upload assertions from the start tests. Consider exposing outputPath.
  3. New warnings: [Obsolete] on WindowsDriver adds CS0618 warnings in test/integration/Windows/*. Please migrate those tests to WincoreDriver or suppress the warning there.
  4. CI: the Android failure (TouchByCoordinatesTestCase, stale element) is the flake fixed in #1143. A rebase on main should clear it.

Nits

  • Settings/SetSetting aren't in #1154 and they depend on AndroidCommandExecutionHelper. Drop them, or implement IHasSettings.
  • Keep one factory (GetWincore… or StartScreenRecordingOptions) and one of WithFps/WithVideoFps. Remove the new WithTimeLimit, which only repeats the base method.
  • LaunchApp/CloseApp can be one-liners: => ExecuteScript("windows: launchApp");
  • using OpenQA.Selenium.Appium.Interfaces; in WincoreDriver.cs is unused.
  • Please revert the BOM removal on the 4 existing files.
  • Initializing ScreenRecordingUploadOptions.Parameters fixes a crash that already happens on main. Worth calling out in the description.

@hoanle0126
hoanle0126 force-pushed the feat/wincore-driver-1154 branch from 8eb42b9 to 3c71226 Compare November 25, 2026 17:48
@hoanle0126

Copy link
Copy Markdown
Contributor Author

Done in 3c71226 after rebasing onto main: marked AppiumDriver recording overloads virtual and overrode them in WincoreDriver to invoke windows: startRecordingScreen and windows: stopRecordingScreen, and removed start upload assertions.

Also added WithOutputPath and DisableForcedRestart, trimmed duplicate helpers, dropped Settings/SetSetting, restored the 4 BOMs, suppressed CS0618 in legacy Windows tests, and updated the PR description.

@Dor-bl Dor-bl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround. Routing recording through windows: startRecordingScreen / windows: stopRecordingScreen looks good, and the rest of the feedback is addressed. CI is green and the build has no new warnings.

Optional nits, fine as a follow-up:

  • WincoreDriverTests could reuse the existing MockCommandExecutor instead of defining its own.
  • The Platform field is used once and could be inlined.

LGTM 👍


namespace OpenQA.Selenium.Appium.Windows
{
public class WincoreStartScreenRecordingOptions : BaseStartScreenRecordingOptions<WincoreStartScreenRecordingOptions>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inheriting WithUploadOptions() here lets callers configure an upload that never happens. Wincore accepts remotePath, user, pass, and method only on windows: stopRecordingScreen. If a caller sets the destination on start and then calls StopRecordingScreen() without options, the server returns the video inline. Could we expose upload configuration only on the Wincore stop options? Server command parameters

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated WincoreStartScreenRecordingOptions in f25848c to implement IScreenRecordingOptions directly instead of BaseStartScreenRecordingOptions, leaving upload options only on WincoreStopScreenRecordingOptions.

}

/// <summary>
/// Path to the folder where the resulting video file should be stored on the host machine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wincore requires outputPath to be a full .mp4 filename. Passing C:\videos, as the mock tests do, raises InvalidArgumentError on the server. Could we update the XML summary, parameter description, and test examples to use a path such as C:\videos\capture.mp4? Server validation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the XML summary, parameter description, and WincoreDriverTests assertions in f25848c to use a full .mp4 path (C:\videos\capture.mp4).

driverOptions.PlatformName = Platform;
}

if (driverOptions is AppiumOptions appiumOptions && string.IsNullOrEmpty(appiumOptions.AutomationName))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All constructors accept DriverOptions, but this type check skips the appium:automationName default for other implementations. For example, passing EdgeOptions without an explicit automation name sends a session request that Appium cannot route to Wincore. Could we apply the default whenever the outgoing capabilities lack it, or narrow the constructors to AppiumOptions if that is the intended contract?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated WincoreDriver in f25848c so any DriverOptions without appium:automationName defaults it to Wincore, with an EdgeOptions test added.

@KazuCocoa
KazuCocoa merged commit 1b5fc3a into appium:main Nov 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Add Wincore driver support

4 participants