dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.98k stars 776 forks source link

Failed to execute 'querySelectorAll' on 'Document': '[' is not a valid selector. #3058

Closed rajeshguduru closed 11 months ago

rajeshguduru commented 3 years ago

Getting below issue with Axe-DevTools APIs and chrome browser when UI page contains 3 or more nested iframes. Please reach out to me (rajesh.guduru@sumtotalsystems.com) for more details.

Failed to execute 'querySelectorAll' on 'Document': '[' is not a valid selector. Error: at yu (eval at executeScript (:445:16), :14:333603) at new vu (eval at executeScript (:445:16), :14:335299) at Nu (eval at executeScript (:445:16), :14:339838) at _u (eval at executeScript (:445:16), :14:340593) at Hr (eval at executeScript (:445:16), :14:97761) at St (eval at executeScript (:445:16), :14:81702) at e (eval at executeScript (:445:16), :14:82217) SyntaxError: at eval (eval at executeScript (:445:16), :14:77903) at nt (eval at executeScript (:445:16), :14:77912) at St (eval at executeScript (:445:16), :14:81456) at e (eval at executeScript (:445:16), :14:82217) SyntaxError: at eval (eval at executeScript (:445:16), :14:77903) at nt (eval at executeScript (:445:16), :14:77912) at St (eval at executeScript (:445:16), :14:81456) at e (eval at executeScript (:445:16), :14:82217)

Accessibility tests working fine using Axe devtools-Pro and open source chrome extension. Pls find below image

GoalsPage-WithChromePro

Env details:

straker commented 3 years ago

Thanks for the issue. We'll make sure to let the appropriate people know.

jkoelewyn commented 2 years ago

This is a major blocker. We are stuck on V4.1.0 until this is resolved. Is there any ETA on this? Thank you!

WilcoFiers commented 2 years ago

@jkoelewyn Do you have a public page where this issue can be reproduced?

dylanb commented 2 years ago

@WilcoFiers @jkoelewyn I am not sure I even understand the issue. Where is the crash occurring? Are you aware that the selectors that axe-core returns for iframes are nested arrays that have to be pulled apart and executed sequentially in each frame in order to locate the element?

jkoelewyn commented 2 years ago

My team is working on putting this together

WilcoFiers commented 2 years ago

@jkoelewyn Much appreciated.

Sunny-0929 commented 2 years ago

I am at @jkoelewyn 's team. We found the problem which caused the test failure in axe-core-cucumber/axe-core-api version 4.3.2. However, the same test was passed in version 4.1.0. This is the step which had the different test results:

Then the page should be axe clean excluding ". rbt-input-main" according to: wcag2a, wcag2aa, wcag21aa

  uncaught throw {"errorMessage"=>"Failed to execute 'querySelectorAll' on 'Document': '. rbt-input-main' is not a valid selector.", "passes"=>[], "timestamp"=>"Fri Feb 25 2022 15:11:13 GMT-0500 (Eastern Standard Time)", "url"=>"", "violations"=>[]} (UncaughtThrowError)

The problem is element “. rbt-input-main” incorrectly has a space between “.” and “rbt”.

We just want to double check whether axe behaves differently for version 4.3.2, hence is able to find the element error mentioned above.

WilcoFiers commented 2 years ago

@Sunny-0929 Could you try updating to axe-core 4.4.0. It has a fix in it related to selectors. I'm still not sure how to reproduce this issue, but perhaps it is already resolved.

Sunny-0929 commented 2 years ago

@WilcoFiers, CC: @jkoelewyn Currently we are using the following in our Ruby gemfile: gem 'axe-core-api', '4.3.2' gem 'axe-core-cucumber', '4.3.2'

I believe the latest version is 4.3.2: https://github.com/dequelabs/axe-core-gems

How to update our gemfile to use axe-core 4.4.0?

straker commented 2 years ago

@Sunny-0929 it looks like our Github release failed, but both packages should be available from ruby as version 4.4.0

https://rubygems.org/gems/axe-core-api https://rubygems.org/gems/axe-core-cucumber

Sunny-0929 commented 2 years ago

Thanks! @straker I will try it.

straker commented 2 years ago

@Sunny-0929 were you able to update to the latest ruby gems? Is this still an issue?

straker commented 11 months ago

Closing due to lack of activity. Going to assume you were successfully able to update to the latest ruby gems and it fixed the issue. Please feel free to reopen if you can provide more information.

Sunny-0929 commented 11 months ago

Yeah, we were all set. thanks!