Hi, in a specific scenario, I need to get full control over my mouse, and with the help of actions () the class m is not able to do this. There is a map in my application, and there is a function that uses lasso to select a specific part (let's say we draw a circle with a lasso, and the choice is represented by a red circle), then additional navigation appears only for pop-ups. But when I use the action class as shown below
var loc = element(by.xpath("//span[@id='imgLasso']"));
browser.actions()
.mouseMove(loc, {x: 550, y: 436})
.mouseDown()
.mouseMove({x: 700, y: 236})
.perform();
the actual mouse movement occurs and I cannot find a solution other than using the java robot class.hence. I want to create a batch file that calls a java class with robot methods, but I'm not sure how to do this. Please help UPDATE
it("working with lasso",function(){
browser.sleep(5000);
element(by.xpath("//span[@id='imgLasso']")).click();
var plot0 = element(by.xpath("//span[@id='imgLasso']"));
browser.sleep(2000);
browser.actions()
.mouseMove({x: 100, y: 100})
.mouseDown()
.mouseMove({x: 400, y: 0})
.perform();
browser.sleep(8000);
element(by.xpath("//*[@id='imputTerritory']")).sendKeys("NewTeritory");
});
when executing the above code, my observations are given below
1.Till var = plot0 line,code is executed normally.
2.After that browser.action()... get executed only just before chrome is closed by protractor.don't know why.(also i have included sleep to verify that)
2.Also just before chrome is closed i can see a straight red line on the map.but not followed by any pop up (is it possible mouse is not released by actions class)
m, - plot0 m, , spec.