get list of events associated with a DOM elements get list of events associated with a DOM elements selenium selenium

get list of events associated with a DOM elements


You can do this to a certain extent with python + selenium (chrome only):

body = driver.execute_cdp_cmd("Runtime.evaluate", {"expression": "document.body"})listeners = driver.execute_cdp_cmd("DOMDebugger.getEventListeners", {"objectId": body["result"]["objectId"]})


To whom it may concern, in the future!

The solution offered by @pguardiario collects most of the events, but not React and jQuery, as far as I tested this solution.

To overcome this problem and collect React and jQuery events I dug deep into firefox source code and found out that firefox uses sort of a parser, to show React and jQuery events, same as Visual Events 2 solution.