Wrong location with Chrome and Firefox

Asked

Viewed 47 times

0

I’m capturing the Location of an image element. When I search for Phantom, it brings the correct X/Y coordinates, but if I do it through Chrome or Firefox, it gives another Location and then I can’t get the contents of the element.

See below the coordinates of the same element, captured with Phantom and Chrome:

Coordinates by the Phantom: X = 0x00000375 Y = 0x00000180

Coordinates by Chrome: X = 0x000003c1 Y = 0x00000184

  • in these cases each browser will have its own particularity of positioning. I don’t know your purpose but I’d have to capture this different location for every browser I’m using.

  • It shouldn’t be. The element.Location must be the same, independent of the browser, isn’t it? All the searches I do to get the element printscreen, the function is always the same. Then I conclude it should be the same. My suspicion is that my machine has some problem with positioning, because when I run through the Phantom, it has no GUI

  • Solved (partially) running Chrome and Firefox in HEADLESS mode. So there is no GUI and it works perfectly there.

  • Phantom is headless, so it’ll make a difference.

1 answer

0


I found the problem: on the computer I’m using, the scaling adjustment and layout of the video was at 125%, as recommended.

inserir a descrição da imagem aqui

This change caused the driver to capture the deposicionated coordinates and therefore worked in headless, since it did not use the GUI.

I went back to 100% display and it worked perfectly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.