Selenium multiple tabs at once

前端 未结 7 1507
孤城傲影
孤城傲影 2020-11-27 17:24

I\'m working with Selenium, and am wondering if it\'s possible to use multiple TABS at once? I do not want to use multiple browser instances (i.e., 2 copies of IE pun). IF I

7条回答
  •  离开以前
    2020-11-27 17:46

    This will solve your problem in case ur working with selenium and nodejs.

    driver.get('https://www.google.com/')
      .then(_ =>
        driver.findElement(webdriver.By.tagName('body'))
      )
      .then(bodyElement => {
        bodyElement.sendKeys(webdriver.Key.chord(webdriver.Key.CONTROL, 't'))
      })
      .catch(err => {
        console.log(err);
      })
    

提交回复
热议问题