How to handle multiple tabs in automation test in UnitTest on LambdaTest?

Tell me how I can handle multiple tabs in automation test in UnitTest.

Hello Devan,

You can easily handle multiple tabs in automation test in UnitTest.

For opening a new tab, here is the needed line of code:

driver.execute_script(“window.open(‘about:blank’,‘secondtab’);”)

For switching to the new tab, here is the line of code:

#by using tab name driver.switch_to.window(“secondtab”)

Download and configure the GitHub repo for more details:

https://github.com/Elmasekar/UnitTest-multiple-tabs