github seleniumbase/SeleniumBase v1.33.0
Add the inspect_html() method

latest releases: v4.26.1, v4.26.0, v4.25.4...
4 years ago

Add the inspect_html() method

This uses https://cdnjs.com/libraries/html-inspector
and https://github.com/philipwalton/html-inspector

Sample code:

from seleniumbase import BaseCase

class MyTestClass(BaseCase):
    def test_html_inspector(self):
        self.open("https://xkcd.com/1144/")
        self.inspect_html()

Run command:

pytest test_inspect_html.py

Sample output:

* HTML Inspection Results: https://xkcd.com/1144/
X - https://xkcd.com/usNews - Failed to load resource: the server responded with a status of 404 (Not Found)
X - 'property' is not a valid attribute of the <meta> element.
X - Do not use <div> or <span> elements without any attributes.
X - The 'alt' attribute is required for <img> elements.
X - The 'border' attribute is no longer valid on the <img> element and should not be used.
X - 'srcset' is not a valid attribute of the <img> element.
X - The <center> element is obsolete and should not be used.
X - <script> elements should appear right before the closing </body> tag for optimal performance.
X - The id 'comicLinks' appears more than once in the document.
* (See the Console output for details!)

Don't miss a new SeleniumBase release

NewReleases is sending notifications on new releases.