diff --git a/src/common/UITestAutomation/SessionHelper.cs b/src/common/UITestAutomation/SessionHelper.cs index b12b1f831b..5cee5dcffe 100644 --- a/src/common/UITestAutomation/SessionHelper.cs +++ b/src/common/UITestAutomation/SessionHelper.cs @@ -122,23 +122,31 @@ namespace Microsoft.PowerToys.UITest public void StartExe(string appPath, string[]? args = null) { var opts = new AppiumOptions(); - opts.AddAdditionalCapability("app", appPath); - if (args != null && args.Length > 0) + if (scope == PowerToysModule.PowerToysSettings) { - // Build command line arguments string - string argsString = string.Join(" ", args.Select(arg => + TryLaunchPowerToysSettings(opts); + } + else + { + opts.AddAdditionalCapability("app", appPath); + + if (args != null && args.Length > 0) { - // Quote arguments that contain spaces - if (arg.Contains(' ')) + // Build command line arguments string + string argsString = string.Join(" ", args.Select(arg => { - return $"\"{arg}\""; - } + // Quote arguments that contain spaces + if (arg.Contains(' ')) + { + return $"\"{arg}\""; + } - return arg; - })); + return arg; + })); - opts.AddAdditionalCapability("appArguments", argsString); + opts.AddAdditionalCapability("appArguments", argsString); + } } this.Driver = NewWindowsDriver(opts);