1

I would like to open a new tab in selenium. Additionally, I would like to click on a button that appeared in the new tab.

driver.execute_script("window.open('')")
driver.switch_to_window(driver.window_handles[1])
driver.find_element_by_xpath()

This my code. The problem is that with "driver.find_element_by_xpath()" I can only click on elements that are on the main window.

eightmax
  • 13
  • 4
  • 2
    create minimal working code which we could run. Maybe you have to open tab in different way - so it will be activate - and then it will work. – furas Sep 13 '20 at 15:16
  • Welcome to SO please read [mcve] and edit your post accordingly – Dev Sep 13 '20 at 16:19

0 Answers0