Skip to content

Commit 232bd58

Browse files
committed
[dotnet] implement ability to launch chromium application
1 parent ab6a867 commit 232bd58

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dotnet/src/webdriver/Chromium/ChromiumDriver.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public abstract class ChromiumDriver : WebDriver, ISupportsLogs, IDevTools
4949
private const string DeleteNetworkConditionsCommand = "deleteNetworkConditions";
5050
private const string SendChromeCommand = "sendChromeCommand";
5151
private const string SendChromeCommandWithResult = "sendChromeCommandWithResult";
52+
private const string LaunchAppCommand = "launchAppCommand";
5253

5354
private readonly string optionsCapabilityName;
5455
private DevToolsSession devToolsSession;
@@ -81,6 +82,7 @@ public ChromiumDriver(ChromiumDriverService service, ChromiumOptions options, Ti
8182
this.AddCustomChromeCommand(DeleteNetworkConditionsCommand, HttpCommandInfo.DeleteCommand, "/session/{sessionId}/chromium/network_conditions");
8283
this.AddCustomChromeCommand(SendChromeCommand, HttpCommandInfo.PostCommand, "/session/{sessionId}/chromium/send_command");
8384
this.AddCustomChromeCommand(SendChromeCommandWithResult, HttpCommandInfo.PostCommand, "/session/{sessionId}/chromium/send_command_and_get_result");
85+
this.AddCustomChromeCommand(LaunchAppCommand, HttpCommandInfo.PostCommand, "/session/{sessionId}/chromium/launch_app");
8486
}
8587

8688
/// <summary>
@@ -133,6 +135,22 @@ public ChromiumNetworkConditions NetworkConditions
133135
}
134136
}
135137

138+
/// <summary>
139+
/// Launches a Chromium based application.
140+
/// </summary>
141+
/// <param name="id">ID of the chromium app to launch.</param>
142+
public void LaunchApp(string id)
143+
{
144+
if (id == null)
145+
{
146+
throw new ArgumentNullException("id", "id must not be null");
147+
}
148+
149+
Dictionary<string, object> parameters = new Dictionary<string, object>();
150+
parameters["id"] = id;
151+
this.Execute(LaunchAppCommand, parameters);
152+
}
153+
136154
/// <summary>
137155
/// Executes a custom Chrome Dev Tools Protocol Command.
138156
/// </summary>

0 commit comments

Comments
 (0)