I have been debugging a test and found that protractor is finding the correct element but the location (x and y) do not link to the location of the button that has been found. When click is called on this element it misses and clicks the wrong place causing the test to fail.
As a note these tests seem to run fine on other machines with the only difference being the operating system the tests fail on is windows 10?
Does anyone know how protractor / selenium determines the location of the element.
Thanks in advance.
Jack Reeves
EDIT:
After comment requesting some examples:
To get the page object:
browser.get('examplePageAddress')
To get the header that the button is located:
var elem = element.all(by.className('header')).get(0)
To get the div that the button is located within the header:
var div = elem.element(by.name('examplename'))
To get the actual button
var button = element(by.name('exampleButtonName'))
In the actual test a simple button.click() is called and that is what is missing the button by about 50px.
Through debugging and writing to the console I have confirmed that the correct element is selected [using .getInnerHTML()] and by measuring the location of the button determined it is about 50px different [used .getLocation() to determine x and y returned by protractor]