SeleniumHQ / SeleniumHQ/docker-selenium

[🐛 Bug]: MyElement.Click Results in ElementNotInteractableException Error for Firefox

Open
#2,159 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

R-awaiting-answer
Dominant language
Go
Stars
8.7k
Forks
2.5k
Avg merge
10h 16m
Merged PRs (30d)
20

Description

What happened?

Whenever I try to click an element that is slightly out of the viewport, Firefox throws:

Message:  OpenQA.Selenium.ElementNotInteractableException : Element <option> could not be scrolled into view

If I add code to scroll to the element first, then click the element, it works in Firefox

It works fine works in Chrome and Edge without needing to scroll first.

The same test with Firefox works fine on a Windows (Non-docker) grid, as well as works fine locally, without having to scroll first.

Command used to start Selenium Grid with Docker (or Kubernetes)
version: "3"
services:
  node-docker:
    image: selenium/node-docker:4.17.0
    volumes:
      - /share/pqafiles/assets:/opt/selenium/assets
      - /share/pqafiles/config/toml_server1.toml:/opt/bin/config.toml
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - selenium-hub # Not sure this is needed in a dynamic grid either
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443      
      - SE_VNC_NO_PASSWORD=1
      - SE_OPTS=--session-timeout 297 --enable-managed-downloads true

  selenium-hub:
    image: selenium/hub:4.17
    #Prior version used: selenium/node-docker:4.14.1
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"    

// toml_server1.toml
[docker]
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
# start a container with the given image.
configs = [
    "selenium/standalone-firefox", "{\"browserName\": \"firefox\"}",
    "selenium/standalone-chrome", "{\"browserName\": \"chrome\"}",
    "selenium/standalone-edge", "{\"browserName\": \"MicrosoftEdge\"}"
    ]

# URL for connecting to the docker daemon
# Most simple approach, leave it as http://127.0.0.1:2375, and mount /var/run/docker.sock.
# 127.0.0.1 is used because interally the container uses socat when /var/run/docker.sock is mounted 
# If var/run/docker.sock is not mounted: 
# Windows: make sure Docker Desktop exposes the daemon via tcp, and use http://host.docker.internal:2375.
# macOS: install socat and run the following command, socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock,
# then use http://host.docker.internal:2375.
# Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue.
url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20231016"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
# [server]
# host = <ip-from-node-machine>
# port = <port-from-node-machine>
Relevant log output
Message: 
OpenQA.Selenium.ElementNotInteractableException : Element <option> could not be scrolled into view
Operating System

Linux Red Hat 9 Rhel 9

Docker Selenium version (image tag)

node-docker:4.17.0

Selenium Grid chart version (chart version)

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported click failure with the supplied Docker Compose configuration, toml_server1.toml settings, and Selenium image versions. Compare Firefox with Chrome and Edge using the same test and viewport conditions. Done means the Firefox option element can be clicked without a manual scroll, or the issue is narrowed to a documented environment or browser-driver limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops, infrastructure, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.