Greetings to all!
I am not a native speaker of English, so sorry for my fair grammar.
Selenium is the basis for testing web applications in different browsers. I want to ask people who use Selenium for any help. I asked people at the Selenium Google Group, but no one helped me.
I am working on a project with a lot of mouse interaction using Selenium Webdriver. I am writing tests in C #. When my team started using Selenium Webdriver, we noticed that mouse actions (OpenQA.Selenium.Interactions.Actions) have slightly unexpected behavior in IE and work differently in different browsers (and even on different machines). For the first time, I was the only tester to work with mouse actions. I blamed Selenium Webdriver and I tried to find a way to avoid this inaccuracy. I studied this problem for a long time, but without any results. But I do not want to waste your time on the background.
Ok, let me describe the situation. We have created a demo project: a simple page with. And we realized the ability to draw on this canvas by holding the left mouse button. Therefore, I hope this is pretty clear to you.
The next important point is that we turned on logging for the console. That is, we can see the coordinates of the mouse arrow inside the canvas, opening the console.
Then we wrote a test:
Actions a = new Actions(driver); a.Build(); a.MoveToElement(canvas, 100, 100) .ClickAndHold() .MoveByOffset(100, 0) .Release(); a.Perform();
The code is pretty simple. Just moving the mouse arrow to the canvas, then move the mouse arrow to (100, 100), and then move vertically to 100 (with the left left mouse button). As you can understand, the result in the logs should be (200, 100).
But here is the most interesting: my colleagues have the same result (200, 100)! But they had an inaccuracy 1 month ago (why did we think that the mouse actions were not accurate). And I still have an inaccurate result: (192, 96). Thus, there is a 4px error at 100px offset. My colleagues do not understand what they have changed and why the mouse actions are working correctly or now.
Another interesting thing is that visually (I remind you that we can draw on the canvas) it is absolutely 100px (we hold the mouse button while moving the mouse arrow vertically)! Amazing
So this experiment.
I ask all suitable people to help me solve this problem. It appears only in IE9. And I want to understand the reason for this behavior. How is an action class performed? Does it depend on the mouse driver or something similar? In this case, if that matters, I use a wireless mouse and it has a special driver. Please help me!
PS I tried to change my mouse settings, my screen settings, but no results.
Thanks!
Sincerely, Mikhail Kalygin.