Skip to content

Commit

Permalink
Updating .NET InternetExplorerDriverService to allow using new comman…
Browse files Browse the repository at this point in the history
…d line options for IEDriverServer.exe
  • Loading branch information
jimevans committed Apr 11, 2013
1 parent b5446c1 commit 37e66af
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dotnet/src/WebDriver/IE/InternetExplorerDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public sealed class InternetExplorerDriverService : DriverService
private string host = string.Empty;
private string logFile = string.Empty;
private string libraryExtractionPath = string.Empty;
private bool forceCreateProcessApi;
private string internetExplorerCommandLineSwitches = string.Empty;

/// <summary>
/// Initializes a new instance of the InternetExplorerDriverService class.
Expand Down Expand Up @@ -90,6 +92,27 @@ public string LibraryExtractionPath
set { this.libraryExtractionPath = value; }
}

/// <summary>
/// Gets or sets a value indicating whether the service should force the use of
/// the Windows CreateProcess API when launching Internet Explorer. Defaults to false.
/// </summary>
public bool ForceCreateProcessApi
{
get { return this.forceCreateProcessApi; }
set { this.forceCreateProcessApi = value; }
}

/// <summary>
/// Gets or sets the switches to be used on the command line when launching
/// Internet Explorer. This property is only used when <see cref="ForceCreateProcessApi"/>
/// is set to <see langword="true"/>.
/// </summary>
public string InternetExplorerCommandLineSwitches
{
get { return this.internetExplorerCommandLineSwitches; }
set { this.internetExplorerCommandLineSwitches = value; }
}

/// <summary>
/// Gets the command-line arguments for the driver service.
/// </summary>
Expand Down Expand Up @@ -123,6 +146,15 @@ protected override string CommandLineArguments
argsBuilder.Append(" -silent");
}

if (this.forceCreateProcessApi)
{
argsBuilder.Append(" -force-createprocess");
if (!string.IsNullOrEmpty(this.internetExplorerCommandLineSwitches))
{
argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " -ie-switches={0}", this.internetExplorerCommandLineSwitches));
}
}

return argsBuilder.ToString();
}
}
Expand Down

0 comments on commit 37e66af

Please sign in to comment.