SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.23k stars 8.12k forks source link

[🐛 Bug]: CEF browser is not activating while switching to new window #14508

Open fayizkc opened 3 days ago

fayizkc commented 3 days ago

What happened?

When I switching to new window of my CEF browser by using driver.switchTo().window(winHandle); switched window is running in the background. I tried with Action click, Javascript "window.focus();" method, but still no luck.

How can we reproduce the issue?

//Tried switching with below code,
driver.switchTo().window(winHandle);
Actions actions = new Actions(driver);
actions.moveToElement(driver.findElement(By.tagName("body"))).click().perform();
//or
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("window.focus();");

Relevant log output

First opened window is showing active until we close the driver

Operating System

Window 11

Selenium version

4.17.0

What are the browser(s) and version(s) where you see this issue?

CEF browser (Chrome driver ver. 118.0.5993.70)

What are the browser driver(s) and version(s) where you see this issue?

CEF browser (Chrome driver ver. 118.0.5993.70)

Are you using Selenium Grid?

No

github-actions[bot] commented 3 days ago

@fayizkc, 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!

github-actions[bot] commented 3 days ago

Hi, @fayizkc. Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.