selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: Fairly meaningless backtrace information is added at the expense of backtrace locations.

Open ioquatix opened this issue 2 years ago • 5 comments

What happened?

This line of code here: https://github.com/SeleniumHQ/selenium/blob/240e17b647d754b8d88b606cd1bca6345240c0b1/rb/lib/selenium/webdriver/remote/response.rb#L72 causes Exception#backtrace_locations to return nil.

This is problematic for test frameworks that use the detailed information in backtrace_locations to format errors more effectively.

In addition, the actual information that is added to the backtrace seems less than useful.

I understand the intention of this "feature" but I think significantly more is lost than is gained by including the backtrace from the web server. At present, this is causing my test harness to blow up as it expects backtrace_locations to at least not be nil.

How can we reproduce the issue?

Any code that triggers an error from the Chrome browser, e.g. finding an element that doesn't exist.

Relevant log output

irb(Sus::Output::Backtrace):002:0> exception.backtrace
=> 
["#0 0x555f3355f6d4 <unknown>",                                              
 "#1 0x555f33264187 <unknown>",                                              
 "#2 0x555f332a2717 <unknown>",                                              
 "#3 0x555f332cc132 <unknown>",                                              
 "#4 0x555f332a042a <unknown>",                                              
 "#5 0x555f332cc3ae <unknown>",                                              
 "#6 0x555f332e2f65 <unknown>",                                              
 "#7 0x555f332cbed3 <unknown>",                                              
 "#8 0x555f3329e420 <unknown>",                                              
 "#9 0x555f3329fa93 <unknown>",                                              
 "#10 0x555f335324c0 <unknown>",                                             
 "#11 0x555f33535780 <unknown>",                                             
 "#12 0x555f335351fa <unknown>",                                             
 "#13 0x555f33535c95 <unknown>",                                             
 "#14 0x555f3352465b <unknown>",
 "#15 0x555f33536080 <unknown>",
 "#16 0x555f3350f830 <unknown>",
 "#17 0x555f3354fee7 <unknown>",
 "#18 0x555f335500f5 <unknown>",
 "#19 0x555f3355ecce <unknown>",
 "#20 0x7fae7a6aa9eb <unknown>",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/response.rb:55:in `assert_ok'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/response.rb:34:in `initialize'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/http/common.rb:83:in `new'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/http/common.rb:83:in `create_response'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/http/default.rb:103:in `request'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/bridge.rb:601:in `execute'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/remote/bridge.rb:400:in `clear_element'",
 "/home/samuel/.gem/ruby/3.2.2/gems/selenium-webdriver-4.15.0/lib/selenium/webdriver/common/element.rb:223:in `clear'",
 "/home/samuel/Projects/oriontransfer/socketry.io/fixtures/website_context.rb:96:in `fill_in'",
 "test/pages/customer.rb:30:in `block (3 levels) in <top (required)>'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-0.23.0/lib/sus/it.rb:50:in `block in handle_skip'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-0.23.0/lib/sus/it.rb:49:in `catch'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-0.23.0/lib/sus/it.rb:49:in `handle_skip'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-0.23.0/lib/sus/it.rb:43:in `block (2 levels) in call'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-0.23.0/lib/sus/base.rb:28:in `around'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-fixtures-async-0.1.2/lib/sus/fixtures/async/reactor_context.rb:69:in `block (2 levels) in around'",
 "/home/samuel/.gem/ruby/3.2.2/gems/sus-fixtures-async-0.1.2/lib/sus/fixtures/async/reactor_context.rb:36:in `block in run_with_timeout'",
 "/home/samuel/.gem/ruby/3.2.2/gems/async-2.6.5/lib/async/task.rb:160:in `block in run'",
 "/home/samuel/.gem/ruby/3.2.2/gems/async-2.6.5/lib/async/task.rb:330:in `block in schedule'"]
irb(Sus::Output::Backtrace):003:0> exception.backtrace_locations
=> nil

Operating System

Arch Linux

Selenium version

Ruby selenium-webdriver-4.15.0

What are the browser(s) and version(s) where you see this issue?

Chromium 119.0.6045.159 Arch Linux

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 119.0.6045.159 (eaa767197fa7dd412133d1b84f7eb60da43409c9-refs/branch-heads/6045@{#1327})

Are you using Selenium Grid?

No response

ioquatix avatar Nov 30 '23 08:11 ioquatix

@ioquatix, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Nov 30 '23 08:11 github-actions[bot]

@ioquatix, thank you for creating this issue. We will troubleshoot it as soon as we can.

Info for maintainers

I would like to contribute! Are there any maintainers that would be willing to review/accept my work?

iszambrano avatar Dec 03 '23 03:12 iszambrano

We are happy to receive contributions. For Ruby, @titusfortner can help review.

pujagani avatar Dec 06 '23 05:12 pujagani

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

github-actions[bot] avatar Feb 25 '24 17:02 github-actions[bot]

@titusfortner I will try to continue the work that @ioquatix my PR is a first attempt at bug fixing this so whenever it gets reviewed I will do the changes accordingly

aguspe avatar Jun 22 '24 00:06 aguspe

Fixed in #14170

p0deje avatar Jul 16 '24 18:07 p0deje

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Aug 15 '24 22:08 github-actions[bot]