-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Specify LogPath variable in C# #7259
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
Comments
The .NET bindings' If you want to do this via the .NET bindings, you'll do so by using standard .NET techniques for capturing the output of console applications. That is to say, you need to modify the The first is easy, and is available today in 4.0-alpha1 of the .NET bindings. To modify this object, you'll need to attach to the The second part is not possible in the latest releases of the .NET bindings, and will need to wait until 4.0-alpha2 to be available. An example would look something like the following:
|
Can I request this feature to be added with C#? |
@rj-max What feature? I already mentioned that the full example provided above would be available in 4.0-alpha2 (already added in 9f90d99). There is no plan to release another 3.x release of the .NET bindings. Given that the pattern of the .NET bindings’ |
If the service classes are meant to reflect the subprocess’ flags identically in their API, is it an option to introduce an intermediary abstraction that offers a more user-friendly API and that maps down to the right flags? |
@rj-max, this probably doesn't help now since it's two years later, but the following does work for me in my initial testing to log all the lower-level, geckodriver output to a log file that was bubbling up and inter-mixing with all my C# program's higher-level, output and ruining all my own, nice Console.WriteLine("blah") output I was trying to log out to a file :-) I'm trying to convert a Python script (has always worked great) to a stand-alone C# dotnet script file and the lack of direct logging in the C# implementation was quite the "surprise" to me and been the biggest headache of all in this for me. note: I've been using a Python script for two years that uses geckodriver with Selenium and, of course, the Python library has the ability to specify a log_file for all the back-end geckodriver output built right into the constructor so I had been completely surprised, disappointed, and frustrated just like you not being able to do something so simple using C# library; anyway, I digress..
Inspiration for this came from stackoverflow
So, now because of #2 above, all the low-level geckodriver output goes to a different log file ... just like you can do in Python with a very simple "log_path" property setting:
I hope this helps somebody (and works for them), I searched the entire interwebs trying to find a way to do this! And I agree with you, I would hope the C# implementation considers adding the functionality that Python has already afforded for some time. |
Thank you for chiming in, but as mentioned at the beginning, this will be added to .NET when this https://bugzilla.mozilla.org/show_bug.cgi?id=1611003 is solved and released. I understand the frustration when a binding offers a feature and the other one does not. This is something we are actively improving to avoid these types of situation, now we are consistently aiming to have cross binding feature parity. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is it possible to provide a way to specify LogPath in FirefoxDriverService class with dotnet bindings? I have a VM running tests using Selenium WebDriver and it crashes frequently. Without enabling these logs, it's not possible to dig deeper. I notice that this log_path is available in Python language bindings but not dotnet.
The text was updated successfully, but these errors were encountered: