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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top