-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Simplify DriverService and DriverFinder
#15028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -428,5 +428,29 @@ private bool WaitForServiceInitialization() | |
|
|
||
| return isInitialized; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Uses DriverFinder to set Service attributes if necessary when creating the command executor | ||
| /// </summary> | ||
| /// <param name="options">The <see cref="DriverOptions"/> to be used with the driver.</param> | ||
| /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> | ||
| /// <param name="searchForBrowserPath">Whether to search for browser binaries.</param> | ||
| /// <returns>A command executor.</returns> | ||
| internal DriverServiceCommandExecutor CreateCommandExecutor(DriverOptions options, TimeSpan commandTimeout, bool searchForBrowserPath) | ||
| { | ||
| if (DriverServicePath == null) | ||
| { | ||
| DriverFinder finder = new DriverFinder(options); | ||
| string fullServicePath = finder.GetDriverPath(); | ||
| DriverServicePath = Path.GetDirectoryName(fullServicePath); | ||
| DriverServiceExecutableName = Path.GetFileName(fullServicePath); | ||
| if (searchForBrowserPath && finder.TryGetBrowserPath(out string browserPath)) | ||
| { | ||
| options.BinaryLocation = browserPath; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting binary location for IE is not supported (at runtime).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have the bool |
||
| options.BrowserVersion = null; | ||
| } | ||
| } | ||
| return new DriverServiceCommandExecutor(this, commandTimeout); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to add both after exceptions, because
pathsis a shared state which can be corrupted if used wrong.