Skip to content

Commit

Permalink
Remove option to manually handle web driver
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxModule committed Dec 6, 2022
1 parent 185fdc6 commit c6023a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
21 changes: 10 additions & 11 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,21 @@ public static void Main(string[] args)
"profile-directory=Profile 1",
$"app={options.PlexUrl}");

var edgeProcessName = "msedge";
var edgeProcessIds = Process.GetProcessesByName(edgeProcessName).Select(p => p.Id);

EdgeDriverService service;
if (options.ManualHandleWebDriver)
try
{
service = EdgeDriverService.CreateDefaultService();
WebDriverManager.AutoUpdate();
}
else
catch (Exception exception)
{
WebDriverManager.AutoUpdate();

service = EdgeDriverService.CreateDefaultService(
WebDriverManager.MsEdgeDriverDirectoryName, WebDriverManager.MsEdgeDriverFileName);
LogException(exception);
}

var edgeProcessName = "msedge";
var edgeProcessIds = Process.GetProcessesByName(edgeProcessName).Select(p => p.Id);

var service = EdgeDriverService.CreateDefaultService(
WebDriverManager.MsEdgeDriverDirectoryName, WebDriverManager.MsEdgeDriverFileName);

var driver = new EdgeDriver(service, edgeOptions);
var browserProcessId = Process.GetProcessesByName(edgeProcessName).Select(p => p.Id)
.Except(edgeProcessIds)
Expand Down
5 changes: 1 addition & 4 deletions ProgramOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ public class ProgramOptions
[Option('d', "debug", Required = false, HelpText = "Show console window.")]
public bool ShowConsoleWindow { get; set; }

[Option('m', "manual-driver", Required = false, HelpText = "Manually handle MS Edge Web Driver.")]
public bool ManualHandleWebDriver { get; set; }

[Option('w', "wait-time", Required = false, Default = 2500,
[Option('w', "wait-time", Required = false, Default = 3000,
HelpText = "Time to wait after Skip Button becomes visible before clicking.")]
public int SkipButtonWaitTime { get; set; }

Expand Down

0 comments on commit c6023a6

Please sign in to comment.