((JavascriptExecutor) webDriver).executeScript("window.focus();");
should do the trick!
More Related Contents:
- What Is Selenium And What Is WebDriver?
- NoSuchElementException, Selenium unable to locate element
- Can Selenium interact with an existing browser session?
- What is the difference between cssSelector & Xpath and which is better with respect to performance for cross browser testing?
- How to run Selenium WebDriver test cases in Chrome
- Can Selenium WebDriver open browser windows silently in the background?
- Is there a version of Selenium WebDriver that is not detectable?
- Many process of Google Chrome (32 bit)
- How to launch all Karate features setting up which browser to use as an external maven variable
- Reached error page: about:neterror when trying to navigate to other tabs if there is a form submit under that tab
- selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element:
- How to download an image using Selenium (any version)?
- Selenium WebDriver how to close browser popup
- Need to find element in selenium by css
- org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view when trying to click a button
- What is the exact purpose of Selenium Grid?
- Selenium WebDriver.get(url) does not open the URL
- How do you click on a checkbox from a list of checkboxes via Selenium/Webdriver in Java?
- What is the difference between a CSS selector and XPath? And which is better with respect to performance for cross-browser testing?
- org.openqa.selenium.InvalidCookieDomainException: Document is cookie-averse using Selenium and WebDriver
- What is the difference between a CSS and XPath selector? And which is better with respect to performance for cross-browser testing?
- I need to find an element in Selenium by CSS
- Which is the best and fastest way to find the element using webdriver? By.XPath or By.ID or anything else? And why? [closed]
- org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities while initiating Firefox v37 through Selenium v3.11.0
- Selenium how to manage wait for page load?
- selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
- Get PID of Browser launched by selenium
- How does Selenium WebDriver’s isDisplayed() method work
- what’s the relationship between Selenium RC and WebDriver?
- Switch between two browser windows using Selenium WebDriver