How can I highlight element on a webpage using Selenium-Python?

admin

Administrator
Staff member
I have been handed over a existing selenium framework which uses python for scripting. For debugging(& other) purposes, I would like to highlight the element on which action is being taken currently (input box, link, drop-down etc.)

Though I could find solutions to define a function and calling the function wherever I need to highlight the element(as examples given below), what I need is a solution at the framework level.

<ol>
<li><a href="https://stackoverflow.com/questions/10791866/selenium-webdriver-highlight-element-before-clicking">Selenium webdriver highlight element before clicking</a></li>
<li><a href="https://seleniumwithjavapython.word...ecutor/highlighting-a-web-element-on-webpage/" rel="nofollow noreferrer">https://seleniumwithjavapython.word...ecutor/highlighting-a-web-element-on-webpage/</a></li>
</ol>

Is it possible to implement any solution at the framework / script level in Python (or any other language which can be integrated with python scripts), so that I don't have to call the functions explicitly.

P.S. I am just beginning to use Python, so excuse me if its a simple/straight forward. Will appreciate if someone can point me to any existing solution or can provide their own solution.