Outlook opens in old version in chrome headless mode. How to resolve it in Selenium C#

245 Views Asked by At

While running chrome in headless mode outlook open as in the older version

enter image description here

It should open with the latest outlook web mode

enter image description here

Note: When we run in chrome browser (with head) it opens the outlook with latest UI

Is there anything should i add in ChromeArgument?

1

There are 1 best solutions below

0
Pradeep Selvaraj On

Headless mode user agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/109.0.5414.120 Safari/537.36

Whereas the real Chrome user agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

we need to override the chrome argument while initializing the chromedriver

chromeOptions.Add("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36");