I am trying to use the SetPreference() method in Selenium with VBA to login to website using user details.
Below is the code.
Sub setttt()
Dim driver As New ChromeDriver
Set driver = New ChromeDriver
driver.Get ("https:www.gmail.com/")
driver.AddArgument ("--no-sandbox")
driver.SetPreference ("user-data-dir=C:/Users/sagar/AppData/Local/Google/Chrome/User Data/Default")
driver.Wait (500)
End Sub
I am getting a compile error
Argument not optional
Please help if I am missing anything here.