chrome extension force mouse move

15,895

Solution 1

Consider using Selenium for this. It has support for many languages, and you can script your whole test with it. You can for example set it to click on an element, wait for something to happen or fill text boxes.

Solution 2

Imagine some random website controlling your mouse ... not cool, is it? (That's why you cant force mousemove via javascript)

However, you can trigger clicks on elements. To achieve that, you need to save the event(mouse-over|out/(dbl)click/whatever) and the according element (in the eventfunction: this). That should be sufficient to simulate theworkflow.

jQuery-Example:

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

vanilla javascript:

document.querySelector("#item").click();
Share:
15,895
mraiur
Author by

mraiur

Updated on June 18, 2022

Comments

  • mraiur
    mraiur over 1 year

    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.