-
Notifications
You must be signed in to change notification settings - Fork 27
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
Manager#logs deprecation warning after upgrading to Selenium 4.0 #34
Comments
Hi @TamasGombos! I see, so they moved everything from My issue for patching this is getting a minimal reproduction/environment to test in, so I can ensure I made the right changes. I'd rather not just blindly remove the Something like this could work: def logs(type)
browser = Capybara.current_session.driver.browser
if browser.respond_to?(:manage)
# Support older Selenium versions < 4
browser.manage.logs.get(type)
else
# Support Selenium version 4+
browser.logs.get(type)
end
end Would it be possible for you to help me get a reproduction of this warning? What could I (minimally) do in this repository to start generating this warning? |
Sure! Thanks for the quick reply! Also upgraded our chromedriver and chrome versions to 94, but I don't think that is related. So I would say, just try to update the gems used, run a basic test, that opens a page, and gets a loggable console error, and it should start throwing this error. I'll try to set up the repository locally, and make an example fail. |
After a bit of messing around with the repository, I was able to make it work, and reproduce the issue I've got. Two of the tests failed on my setup, but that's probably because of Chrome logging level settings. I forked the repository, you can find the reproduction branch here: I also tried the fix you proposed, and it returned the same warning. Selenium 4.0 still supports the 'manage', so the browser responds to it. You will need: (I used Debian Bullseye)
Run logs without fix:
Run logs with branching fix:
Run logs with .manage removal fix:
|
@dbalatero Is there anything I can do to help? Is @rubendinho's patch mergable? |
The patch rubendinho@10632e6 works fine for me |
Any update to this? Could #38 get merged? |
I would also love to get this fixed... Is it going to be in a near future, or can i run the patched version somehow? |
Yes you can run a forked version like this: I recommend making your own fork so your bundle doesn’t break if it’s yanked. |
Curious what the holdup on this is. This breaks hard in
Happy to help or submit a sponsorship to get this across the finish line. |
Sorry, I haven't been using Rails or Capybara for 3 years now and don't have a great test setup here. I'm checking in on #38 - it can be merged, but I don't know the state of things and whether it warrants a hard major version bump since it might be a breaking API change for older clients? |
@dbalatero I think a major release will be a good first step. From what you've said it might also be a good opportunity to re-home the project to another maintainer. What do you think? |
@dbalatero Can we rehome this repo as @benschwarz requested? |
Relevant to make it work with Chrome 120: SeleniumHQ/selenium#13112. TLDR: use |
Hi!
After I updated my gemfiles to use Selenium 4.0, I received a few of these warnings:
2021-10-19 13:48:26 WARN Selenium [DEPRECATION] Manager#logs is deprecated. Use Chrome::Driver#logs instead.
After a few hours of research, I found out that they deprecated the use of Manager:
https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES#L36
The workaround for me was to remove Manage from here:
capybara-chromedriver-logger/lib/capybara/chromedriver/logger/collector.rb
Line 56 in 60e7a9c
After I removed it, and reran my tests, the deprecation warnings disappeared, and the console log reports were generated just fine.
I know that currently capybara-chromedriver-logger supports Selenium > 3 and Selenium < 4, but maybe for future versions it would be cool to handle this deprecation warning.
I am glad to help with more information, or anything needed.
Thank you!
The text was updated successfully, but these errors were encountered: