How to open a new window on a browser using Selenium WebDriver for python

0 votes
I am attempting to open a new tab OR a new window in a browser using selenium for python. It is of little importance if a new tab or new window is opened, it is only important that a second instance of the browser is opened.

I tried several different methods but none have succeeded.
Aug 23, 2018 in Selenium by ghost
• 1,790 points
6,444 views

1 answer to this question.

0 votes

You can try the below code:

driver = webdriver.Firefox() #First FF window
second_driver = webdriver.Firefox() #The new window you wanted to open

Depending on which window you want to interact with, you send commands accordingly

print driver.title #to interact with the first driver
print second_driver.title #to interact with the second driver
answered Aug 23, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
16,033 views
0 votes
2 answers
0 votes
1 answer

How to open a new browser tab using Ruby Selenium Webdriver?

Hi Utkarsh, you can use JS Executor ...READ MORE

answered Aug 27, 2019 in Selenium by Abha
• 28,140 points
3,944 views
+1 vote
1 answer
0 votes
1 answer

How to Hover using Mouse in python using Webdriver

from selenium.webdriver.common.action_chains import ActionChains def hover(self): ...READ MORE

answered Aug 8, 2018 in Selenium by Meci Matt
• 9,460 points
2,432 views
+1 vote
2 answers

Python with Selenium issue: “Chrome is being controlled by automated test software”

from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("useAutomationExtension", False) chrome_options.add_experimental_option("excludeSwitches",["enable-automation"]) driver ...READ MORE

answered Apr 20, 2020 in Selenium by Manoj
15,896 views
0 votes
8 answers

How to open a link in new tab of chrome browser using Selenium WebDriver?

This below code works for me in ...READ MORE

answered Dec 14, 2020 in Selenium by Gitika
• 65,770 points
103,024 views
0 votes
1 answer

How to I switch to a new window for links with “blank” targets using Capybara?

Capybara 2.3 includes the new window management ...READ MORE

answered Jul 11, 2018 in Selenium by Meci Matt
• 9,460 points
3,870 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP