Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

webdriver python get total number of tabs

def OpenNewTab(driver, Link):
    window_count = len(driver.window_handles)
    driver.execute_script('''window.open("'''+Link+'''","_blank");''')
    while len(driver.window_handles) != window_count+1:
        time.sleep(0.5)
    driver.switch_to.window(driver.window_handles[-1])
Source by pylessons.com #
 
PREVIOUS NEXT
Tagged: #webdriver #python #total #number #tabs
ADD COMMENT
Topic
Name
6+4 =