Skip to content

Commit 2ce5012

Browse files
committed
Adding profile root as well
1 parent 6a9157f commit 2ce5012

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ protected override DriverOptions GetDefaultDriverOptions()
107107
/// Disable truncation of long log lines in GeckoDriver.
108108
/// </summary>
109109
public bool LogTruncate { get; set; }
110+
111+
/// <summary>
112+
/// Directory in which GeckoDriver creates profiles.
113+
/// </summary>
114+
public string? ProfileRoot { get; set; }
110115

111116
/// <summary>
112117
/// Gets or sets the level at which log output is displayed.
@@ -199,6 +204,16 @@ protected override string CommandLineArguments
199204
argsBuilder.Append(" --log-no-truncate");
200205
}
201206

207+
if (!string.IsNullOrEmpty(this.ProfileRoot))
208+
{
209+
if (!Directory.Exists(this.ProfileRoot))
210+
{
211+
throw new ArgumentException($"Profile root directory does not exist: {this.ProfileRoot}", nameof(ProfileRoot));
212+
}
213+
214+
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --profile-root \"{0}\"", this.ProfileRoot);
215+
}
216+
202217
return argsBuilder.ToString().Trim();
203218
}
204219
}

0 commit comments

Comments
 (0)