VBA solution for "Chrome For Testing"

266 views
Skip to first unread message

Don Leverton

unread,
Aug 15, 2023, 9:45:32 AM8/15/23
to ChromeDriver Users
Hi,
I'm a Microsoft Access user that uses SeleniumBasic to perform some web automation.

I had to get my IT department to install "Chrome for Testing" v115.0.5790.170
 and the corresponding ChromeDriver 115.0.5790.170.

When I first ran my code ... it was opening the website in "Regular Chrome" (not "Chrome For Testing")
This would work until the next Chrome update ... so I wasn't satisfied with that.

I researched a bit and discovered that Selenium Basic has a way to specify a path to the binary file that you want to use as the browser.

Relevant VBA code here: (I hope it helps someone else as VBA-specific support is VERY hard to find!)

'Dim drv As New Selenium.ChromeDriver 'Moved to Form Declaration area
'drv.AddArgument "--allowed-ips 127.0.0.1"
drv.SetBinary ("C:\Program Files\Google\Chrome For Testing\chrome.exe") 'This uses the Cft (Chrome for Testing) browser instead of "regular" Chrome

drv.AddArgument "--disable-plugins-discovery"
drv.SetPreference "plugins.plugins_disabled", Array("Adobe Flash Player")
    Dim Mywebsite As String
    Mywebsite = ""
    Mywebsite = "https://www.napaprolink.ca/login.aspx"
    drv.Start
drv.Get Mywebsite
drv.Window.Maximize
'Login
drv.FindElementById("userLoginTextBox").SendKeys (MyUserID)
drv.FindElementById("loginUserControl_passwordTextBox").SendKeys (MyPassword)
drv.Wait 1000
drv.FindElementById("loginUserControl_submitButton").Click
drv.Wait 1000
'Enter VIN
drv.FindElementById("txtVinNumber").SendKeys (MyVIN)
drv.Wait 2000
drv.FindElementById("btnSearchByVinNumber").Click

Don Leverton

unread,
Aug 15, 2023, 9:59:00 AM8/15/23
to ChromeDriver Users

I should also add that I'm on a Windows PC using Windows 10 Business, running Microsoft 365 for Business.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages