6

I am writing a chrome extension that records your actions like ( mouse click, keyboard keyup ). The idea of the extension is to help me and my colleagues to reduce the boring testing of our web based project. I made it to record the events and store it on the dev server as mysql so i can use or share to them. But the problem is replaying the saved actions.

So how if there is a way to force mouse move, mouse click events. Can it be done from flash,java or something like that.

PS. The project is Extjs but i want to make the extension useful for developer using other frameworks and publish it.

4

2 に答える 2

1

あなたのマウスを制御しているいくつかのランダムなウェブサイトを想像してみてください...クールではありませんか?(そのため、JavaScriptを介してmousemoveを強制することはできません)

ただし、要素のクリックをトリガーすることはできます。これを実現するには、イベント(mouse-over | out /(dbl)click / whatever)とそれに応じた要素(eventfunction:this)を保存する必要があります。ワークフローをシミュレートするには、これで十分です。

jQuery-例:

$('#item').click();
$('#item').trigger('click');

バニラJavaScript:

document.querySelector("#item").click();
于 2012-06-11T08:56:12.683 に答える