To configure Chrome to UK BST in Azure Pipeline using C# and Selenium, you can use the following code:
ChromeOptions options = new ChromeOptions();
options.AddArguments("--no-sandbox");
options.AddArguments("--disable-dev-shm-usage");
options.AddArguments("--disable-gpu");
options.AddArguments("--headless");
options.AddArguments("--disable-setuid-sandbox");
options.AddArguments("--dns-prefetch-disable");
options.AddArguments("--lang=en-gb");
options.AddArguments("--disable-extensions");
options.AddArguments("--disable-popup-blocking");
options.AddArguments("--window-size=1920x1080");
options.AddArguments($"--user-data-dir={chromeUserData}");
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");
options.AddArguments($"--disable-time-zone-support=false");
options.AddArguments($"--disable-infobars");
options.AddArguments($"--start-maximized");
options.AddArguments($"--disable-features=LanguageEnforcement");
options.AddArguments($"--disable-features=NetworkService");
options.AddArguments($"--disable-features=VizDisplayCompositor");
options.AddArguments($"--disable-features=RendererCodeIntegrity");
options.AddArguments($"--timezone-id={tzi.Id}");
IWebDriver driver = new ChromeDriver(ChromeDriverService.CreateDefaultService(), options);
This code sets various Chrome options, including setting the language to UK English (--lang=en-gb
) and setting the timezone to GMT Standard Time (--timezone-id={tzi.Id}
). It then creates a new ChromeDriver with these options.
Note that you may need to change the timezone ID ("GMT Standard Time"
) to a different ID depending on your specific needs. You can find a list of valid timezone IDs in the Microsoft documentation.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-22 21:01:21 +0000
Seen: 19 times
Last updated: May 22 '23
How can a role assignment be added to a managed identity that is assigned to a system in Azure?
How can key vault be utilized to access Azure blob storage in Databricks?
How can Oracle Tables in bulk be transferred to Azure Storage using Azure Data Factory?
What is the reason for the authentication failure in Azure GIT?
What is the process of utilizing Forge API with Azure, S3, or other storage systems?
How does UDP multicast work on Windows Azure cloud service?
How can the onpremisessamaccountname be included as a claim in the JWT token for Azure AD?