0

We have some Selenium tests (defined as part of a .NET test project) that work fine when running locally but don't when run from an Azure DevOps pipeline. We currently suspect that something is altering the webdriver settings. Is there a way to log the current webdriver setting during a test run (e.g. whether the browser window is maximised, whether the browser is being run in headless mode), so that we can compare the settings being used in the pipeline versus when the tests are run locally?

    1 Answer 1

    1

    Not sure if your pipelines were running on Microsoft-hosted agents or your self-hosted agents for UI testing, while I would suggest you go through this document to Configure for UI testing - Azure Pipelines | Microsoft Learn.

    Screenshots can be captured in headless mode and used for troubleshooting failures. See also Capture video.

    Visible UI testing using self-hosted Windows agents could provide an interactive way to help you with troubleshooting.

    Additional documents for your reference:

    Decide how to deploy and test your app

    When using the Microsoft-hosted agent, you should use the Selenium web drivers that are preinstalled on the Windows agents (agents named Hosted VS 20xx) because they're compatible with the browser versions installed on the Microsoft-hosted agent images. The paths to the folders containing these drivers can be obtained from the environment variables named IEWebDriver (Internet Explorer), ChromeWebDriver (Google Chrome), and GeckoWebDriver (Firefox). The drivers are not preinstalled on other agents such as Linux, Ubuntu, and macOS agents. Microsoft-hosted agents - Software

    When using a self-hosted agent that you deploy on your target servers, agents must be configured to run interactively with autologon enabled. See Build and release agents.

    3
    • Hi @Alvin Zhao - MSFT, I have upvoted your answer as you've shared some useful information, but it doesn't directly answer my question so I'll hold off on marking it as the accepted answer. I'd like to log the active Webdriver settings, not just for my own benefit in troubleshooting this, but to demonstrate to others what settings are being used.
      – ZenoArrow
      CommentedNov 8, 2024 at 11:02
    • Also, to clarify, the ADO agent in question is a self-hosted agent running in "interactive mode" (i.e. not as a Windows service).
      – ZenoArrow
      CommentedNov 8, 2024 at 11:03
    • Thanks for the update and sure we would always welcome the community experts to share more insights.CommentedNov 11, 2024 at 1:43

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.