I need to change the user agent while using edge via selenium in VBA. I haven't been able to find which command to use in order to do this.
The code i have is below, I need to be able to change the user agent profile of edge to ""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4501.0 Safari/537.36 Edg/91.0.866.0" before I open the site.
Sub idash_test()
Set cd = New Selenium.EdgeDriver
Dim ls As Selenium.SelectElement
Dim rp As Selenium.SelectElement
cd.Start "edge"
cd.Get "http://idash.uhc.com/#/"
Set ls = cd.FindElementByCss("#sel_viewas_001492341").AsSelect
ls.SelectByValue "000791032"
cd.FindElementByLinkText("Reports").Click
Application.Wait (Now + TimeValue("00:00:10"))
cd.FindElementByXPath("/html/body/div[2]/div/span/nav/ul/li[1]/a").Click
Application.Wait (Now + TimeValue("00:00:10"))
cd.FindElementByXPath("/html/body/div[2]/div/span/nav/ul/li[1]/ul/li[2]/a").Click
Application.Wait (Now + TimeValue("00:00:10"))
cd.FindElementByXPath("/html/body/div[2]/div/span/nav/ul/li[1]/ul/li[2]/ul/li[1]/a").Click
Application.Wait (Now + TimeValue("00:00:10"))
End Sub
Bookmarks