ATF - Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2021 02:16 AM
I was facing the below error while asserting a text on a change form .There was a error message generated by g_form.addErrorMessage(). Ia m trying to validate whether its present on the form
Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 07:49 AM
Did you find any solution on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 01:18 AM
I am looking for a solution too. We are experiencing the same issue:
- ATF Test: Assert Text on Page (Custom UI)
- Error Message: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 02:18 AM
I have found the issue and solution.
It seems there is a CSS Import issue in the DOM which causes the error message. Its not actually a fatal error but it does stop ATF from trying to assert for text.
To check whats happening:
1. Open the portal page in question (in my case it was a global issue, so the page didnt matter)
2. Open your browsers developer tools console (usually F12 for chromium)
3. Go to the console and type: window.document.styleSheets
4. Open the list of style sheets and check for any without cssRules like this:
5. Finding the source of the CSS might be an issue, but mine was a Service Portal Dependency (sp_dependency) with the option "Include on page load" activated and it was loading a CSS Include via URL (Source)
As soon as I removed the "Include on page load", the dependency wasnt being loaded on every page. It also seems including CSS via URL Sources skips creating the needed cssRule. Since fontAwesome 4.7.0 is included on every portal page by default, I have also removed the dependency completely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2022 08:29 AM
Hi Oliver. Could you please tell me where exactly I can remove the "Include on page load" option? I have the console open but I am not able to see where is this option.