Skip to content

[🐛 Bug]: select dropdown is misplaced in screenshot on Chrome #15675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
khanxmetu opened this issue Apr 28, 2025 · 3 comments
Open

[🐛 Bug]: select dropdown is misplaced in screenshot on Chrome #15675

khanxmetu opened this issue Apr 28, 2025 · 3 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! C-py Python Bindings D-chrome I-defect Something is not working as intended OS-windows

Comments

@khanxmetu
Copy link

khanxmetu commented Apr 28, 2025

Description

Hi,

When taking the screenshot via Chrome webdriver having select drop-down list expanded, the drop-down list is misplaced with some offset:

Image

From older discussion: https://groups.google.com/g/selenium-users/c/eWYRig7c1C4 This should have been not expanded at all.

Was there any attempt to make it work or has anything changed since causing it to be rendered though misplaced?

Reproducible Code

<html>
<body>
<label for="sort-select">Sorted by:</label>
<select id="my-select">
  <option>---------</option>
  <option>foo</option>
  <option>bar</option>
  <option>baz</option>
</select>
</body>
</html>



from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
s=driver.find_element(By.TAG_NAME, "select")
s.click()
driver.get_screenshot_as_file('a.png')
@khanxmetu khanxmetu added A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended labels Apr 28, 2025
@selenium-ci
Copy link
Member

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

Selenium Triage Team: remember to follow the Triage Guide

@titusfortner
Copy link
Member

Is the issue that the screenshot does not match what you are actually seeing on the screen? Or that clicking the dropdown with a selenium click is displaying the dropdown in a place other than where it would if clicking as a user?

@titusfortner titusfortner added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels Apr 28, 2025
@khanxmetu
Copy link
Author

khanxmetu commented Apr 28, 2025

@titusfortner The screenshot does not match what I am actually seeing on the screen. The browser/native renders the dropdown correctly but in Selenium screenshot it is misplaced.

@github-actions github-actions bot added A-needs-triaging A Selenium member will evaluate this soon! and removed J-awaiting answer Question asked of user; a reply moves it to triage again labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! C-py Python Bindings D-chrome I-defect Something is not working as intended OS-windows
Projects
None yet
Development

No branches or pull requests

3 participants