SeleniumHQ / docker-selenium

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation
http://www.selenium.dev/docker-selenium/
Other
7.93k stars 2.51k forks source link

[🐛 Bug]: VNC clicks not registered in Chromium-based drivers on some webpages in specific scenario #2392

Open vaclavnovotny opened 3 weeks ago

vaclavnovotny commented 3 weeks ago

What happened?

Hello!

I have a use case where I need to use the VNC of a running Selenium session to execute clicks at absolute positions in the stream. Most of the time, everything works fine. However, I encountered a specific scenario when clicking on an item in a menu that appears after hovering over it with the mouse. When the button in such a menu is clicked, nothing happens, as if the website doesn't register the click. On one page, the click registered below the menu.

Please note that this issue is not consistent—on some pages, it works, and on others, it doesn't.

Clicking in hovered menus does not work with the Chrome and Edge drivers. Interestingly, it works fine when using the Firefox driver. Therefore I suspect some issue in the chromium-based driver.

Moreover, on these problematic pages, it doesn't work even when using the NoVNC client.

Here are a few pages where this problem occurs:

https://ysoft.com/ https://printerpssw.com/ https://konicaminolta.com.au/

I understand this is a non-standard use case, but I would greatly appreciate any help, as I am at a dead end.

Thank you in advance!

How to reproduce:

I used NuGet package <PackageReference Include="Selenium.Support" Version="4.24.0" />

And then created .NET 8 console application to just create selenium session:

using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;

var options = new ChromeOptions();
options.AddArgument("--start-fullscreen");
var driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub", UriKind.Absolute), options);

// Navigate to a website where the actual issue is
driver.Navigate().GoToUrl("https://www.ysoft.com");

// Break here and go to the session http://localhost:4444/ui/#/sessions
driver.Quit();

To reproduce the issue, simply navigate to the page, open the navigation menu, hover over a menu item, and click on a link in the displayed menu.

Command used to start Selenium Grid with Docker (or Kubernetes)

docker run -d -p 4444:4444 -p 7900:7900 --env VNC_NO_PASSWORD=1 --shm-size="2g" selenium/standalone-chrome:4.24.0-20240907

Relevant log output

No relevant errors in logs

Operating System

Docker Desktop Ubuntu 22.04.1, also happens in Kubernetes running on linux

Docker Selenium version (image tag)

4.24.0-20240907

Selenium Grid chart version (chart version)

No response

github-actions[bot] commented 3 weeks ago

@vaclavnovotny, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

AkhilAppvolution commented 1 week ago

Subject: Issues with Clicking on Hover Menus in VNC Sessions Using Selenium with Chrome and Edge Drivers

Hello,

I have encountered an issue similar to what was previously described regarding the use of VNC to interact with Selenium sessions for executing clicks at absolute positions in the browser. Specifically, when hovering over a menu and trying to click on an item, the click doesn't always register, or in some cases, it registers below the target. This only seems to happen in Chromium-based browsers (Chrome and Edge) while using VNC.

Like the earlier scenario, I've noticed that this problem occurs inconsistently across different websites. For example, on some pages, it works fine, while on others, the click doesn’t trigger any action. For instance, on the following websites, I've noticed these issues with hovering menus while using VNC:

In my experience, a similar issue occurs on websites such as:

However, when I run my automation without VNC—directly through the Chrome or Edge driver—the hovering and clicking behavior works perfectly. The problem only manifests when using VNC to perform these actions, especially with Chromium-based browsers.

I suspect this could be related to how the Chromium-based drivers handle hover events in VNC environments. Has anyone else experienced similar issues or found a solution to make hover-based clicks work more reliably across all browsers while using VNC?

I would appreciate any insights or suggestions!

Thank you in advance.