Mouse move

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

Since, if there is a way to force mouse movement, mouse click events. This can be done from flash, java, or something like that.

PS. An Extjs project, but I want to make the extension useful to developers using other frameworks and publish it.

+6
source share
2 answers

Imagine some random website controlling your mouse ... not cool, is it? (This is why you cannot force mousemove through javascript)

However, you can trigger clicks on items. To do this, you need to save the event (mouse-over | out / (dbl) click / whatever) and the corresponding element (in eventfunction: this). This should be enough to simulate a workflow.

JQuery Example:

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

vanilla javascript:

 document.querySelector("#item").click(); 
+1
source

To do this, use Selenium . It supports many languages, and you can script to run your entire test with it. You can, for example, set it to click on an element, wait for something to happen, or fill in text fields.

0
source

Source: https://habr.com/ru/post/917765/


All Articles