Protractor: mouseMove ignoring offset

Created on 4 Oct 2018  路  4Comments  路  Source: angular/protractor

Bug report

  • Node Version: 10+
  • Protractor Version: 5.3.2
  • Angular Version: 1.6+
  • Browser(s): chrome
  • Operating System and Version Ubuntu

I got the following code

`

    const centerX = dimensions.width / 2;
    const centerY = dimensions.height / 2;

    return browser.actions()
        .mouseMove(startingPoint, {
            x: centerX + x, y: centerY - y
        })
        .click()
        .perform();

`

About 3 months ago this was working just fine. We recently did an update and it seems that the offset is completely ignored alltogether. The offsets are valid numbers. I having a hard time trying to understand where the change is happening but overall this is an issue that is now blocking our testing of a map where we draw squares. Do we know why the offset would be ignored?

On another note I tried to just give it an offset

`

    const centerX = dimensions.width / 2;
    const centerY = dimensions.height / 2;

    return browser.actions()
        .mouseMove({
            x: centerX + x, y: centerY - y
        })
        .click()
        .perform();

`

The above yields an error WebDriverError: unknown error: at least an element or offset should be set. I am a bit confused as I did pass an offset.

The last thing I will say is that the doc urls on your official sites are broken for alot of things. You can start by looking at the actions page for your API and try clicking anything.

Most helpful comment

Ok After many hours of trying the answer was to ensure they are int. please update the docs to ensure that people know they cannot use floats.

All 4 comments

Ok After many hours of trying the answer was to ensure they are int. please update the docs to ensure that people know they cannot use floats.

pbrain19, thanks! I've spent hour trying to figure out what's the problem, it was working and then not working, and then working again, depending on location.

I also faced this issue with coordinates, then find the mistake i was doing:
In chrome.conf.js i was doing w3c: false under chromeOptions:
I removed that property from chrome.conf.js then it start working fine for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nt3rp picture nt3rp  路  3Comments

mvolkmann picture mvolkmann  路  3Comments

vishalshivnath picture vishalshivnath  路  3Comments

koshkarov picture koshkarov  路  3Comments

luakri picture luakri  路  3Comments