if the browser window is in bg, then this line doesn\'t work.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webd
This worked for me to bring the browser window to the foreground. I tested using chromedriver on Selenium 3.6.0 on Python 3.
from selenium import webdriver
driver = webdriver.Chrome()
driver.switch_to.window(driver.current_window_handle)
Related answer in Java - https://sqa.stackexchange.com/questions/16428/how-can-i-bring-chrome-browser-to-focus-when-running-a-selenium-test-using-chrom