Is there anybody who used ChromeDriver
to open new tabs in Chrome?
With this code I can open my index.html
in Chrome:
driver = webdriver.Chrome("/usr/bin/chromedriver")
driver.get("localhost:3000")
And then I want to open localhost:3000/cloudPeer.html
in a new tab:
driver.find_element_by_tag_name("body").send_keys(Keys.CONTROL + 't')
driver.get("localhost:3000/cloudPeer.html")
This works well in Firefox, but in Chrome, it can't open a new tab, it just refresh the first page, and open the new page, the first page is now lost.
I want to open these two pages at the same time and do some communication tests between them.
This works for chrome-
driver.execute_script("window.open('https://www.google.com');")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With