Home > Software design >  How to handle a new window and switch to it in Vba
How to handle a new window and switch to it in Vba

Time:10-31

I am trying to handle a new widow and then switch to it. In VBA using selenium and excel

I have tried various means such as

driver.getWindowHandle -however, I can't get it to work, maybe a syntax thing or not viable with vba

Dim currentWindow As Selenium.Window

and then Debug.Print currentWindow this will error out

and many more to no avail

Option Explicit

Private driver As Selenium.ChromeDriver

Sub test()

    Dim FindBy As New Selenium.By
    
   
    Set driver = New Selenium.ChromeDriver
    
    driver.Start baseUrl:=""
    driver.Get "/"
   
     
End Sub




CodePudding user response:

A solution is driver.SwitchToNextWindow.Activate

This will go to the next window

  • Related