github seleniumbase/SeleniumBase v4.6.4
4.6.4 - Add arg for excluding URLs from assert_no_js_errors()

latest releases: v4.27.0, v4.26.4, v4.26.3...
19 months ago

Add arg for excluding URLs from assert_no_js_errors()

  • Add arg for excluding URLs from assert_no_js_errors()

    def assert_no_js_errors(self, exclude=[]):
        """Asserts current URL has no "SEVERE"-level JavaScript errors.
        Works ONLY on Chromium browsers (Chrome or Edge).
        Does NOT work on Firefox, IE, Safari, or some other browsers:
            * See https://github.com/SeleniumHQ/selenium/issues/1161
        Based on the following Stack Overflow solution:
            * https://stackoverflow.com/a/41150512/7058266
        @Params
        exclude -->
            A list of substrings or a single comma-separated string of
            substrings for filtering out error URLs that contain them.
            URLs that contain any excluded substring will get excluded
            from the final errors list that's used with the assertion.
        Examples:
            self.assert_no_js_errors()
            self.assert_no_js_errors(exclude=["/api.", "/analytics."])
            self.assert_no_js_errors(exclude="//api.go,/analytics.go")
        """

Don't miss a new SeleniumBase release

NewReleases is sending notifications on new releases.