Question

As you know, Selenium IDE can show you a script and tell you what element you just manipulated.

I don't know the what happened behind this. Every automation framework can know what element you are clicked, inputed, or selected..

I want to have a console output and display every element I just manipulated in browser.

How can I implement this?

Was it helpful?

Solution

Using jQuery:

$("*").click(function(e) {
    console.log(this);
}.blur(function(e) {
    console.log(this);
};

Just pop this on your page somewhere and it'll log the element that was manipulated whenever it's clicked or selected. I'm sure there are other ways of manipulation, but the above is a start. It would be trivial to add more handlers--.change() and .hover() come to mind.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top