TESTARtool / TESTAR_dev

TESTAR, automated testing through the Graphical User Interface
http://www.testar.org
BSD 3-Clause "New" or "Revised" License
37 stars 24 forks source link

Chrome download bar affects Webdriver mouse coordinates #365

Closed ferpasri closed 1 year ago

ferpasri commented 1 year ago

TESTAR Behaviour

TESTAR uses the function window.screenY + window.outerHeight - window.innerHeight to calculate the y-axis location of the window screen on which the SUT web page is located.

https://github.com/TESTARtool/TESTAR_dev/blob/2caac040af4ff5fdcd2261cb6df3cd8b4a6c88f3/webdriver/resources/web-extension/js/testar.canvas.js#L50-L58

image

Issue

The problem is that the function assumes that the Chrome browser bars, like the Tab bar and URL bars, always start on the top of the browser.
However, some Chrome bars, such as the Downloads bar, can appear at the bottom of the browser. Something that produces a wrong calculation of the y-axis location of the SUT web page.

https://github.com/TESTARtool/TESTAR_dev/blob/2caac040af4ff5fdcd2261cb6df3cd8b4a6c88f3/webdriver/src/org/testar/monkey/alayer/webdriver/CanvasDimensions.java#L103-L104

image

This provokes the WdMouse to wrongly try to obtain the position of the cursor and wrongly try to move the cursor to click web elements.

https://github.com/TESTARtool/TESTAR_dev/blob/2caac040af4ff5fdcd2261cb6df3cd8b4a6c88f3/webdriver/src/org/testar/monkey/alayer/webdriver/WdMouse.java#L99 https://github.com/TESTARtool/TESTAR_dev/blob/2caac040af4ff5fdcd2261cb6df3cd8b4a6c88f3/webdriver/src/org/testar/monkey/alayer/webdriver/WdMouse.java#L115

Possible solutions

  1. Disable the download bar or change to another Chrome option like chrome://flags/#download-bubble, which does not open the bottom bar in the browser.
  2. Fix the Javascript calculation to correctly calculate the y-axis location of the web SUT on the screen.
ferpasri commented 1 year ago

It seems that the download bubble has been the default Chrome option since August 2023.

ramondevries commented 1 year ago

In newer version (>= 117) of chrome the download bar is replaced with a bubble icon. closing, wil not fix for now.