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
1,564 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,420 points

Related Questions In Selenium

0 votes
1 answer

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

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,130 points
3,312 views
0 votes
1 answer
0 votes
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,420 points
420 views
+1 vote
1 answer
0 votes
5 answers
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,420 points
387 views