c# selenium tests on azure download and confirm report files exist

Kev Martin 20 Reputation points
2023-06-07T07:56:07.95+00:00

We have a group of tests in Selenium/C# which click on download report buttons and then validate the report has been created in the local file. We now wish to deploy these tests with our main test suite which runs on azure in a release pipeline. At the moment the tests run fine locally but not on azure. To start we have tried different paths such as

protected const string DownloadPathExt = "C:\\TestFolder\\Release\\net6.0\\";
protected const string DownloadPathExt = "D:\\a\\r1\\a\\TestFolder Regression\\";

I have noticed these are in use during the buils step. This is initially defined here

var options = new ChromeOptions();
options.AddUserProfilePreference("download.default_directory", DownloadPathExt);

And also here

string[] filePaths = Directory.GetFiles(DownloadPath);

As you can see from this output the test is looking in whatever folder I am setting but it is not seeing the report file. So either it is not downloading or it is being created in a different folder.

2023-06-05T10:52:01.9695830Z In procedure ReadXLSFileDownloaded 2023-06-05T10:52:01.9696187Z Checking file D:\a\r1\a_Pi Regression.editorconfig 2023-06-05T10:52:01.9696549Z Checking file D:\a\r1\a_Pi Regression.gitattributes 2023-06-05T10:52:01.9696918Z Checking file D:\a\r1\a_Pi Regression.gitignore 2023-06-05T10:52:01.9697378Z Checking file D:\a\r1\a_Pi Regression\azure-pipelines.yml 2023-06-05T10:52:01.9697840Z Checking file D:\a\r1\a_Pi Regression\azure-test-pipelines.yml 2023-06-05T10:52:01.9698236Z Checking file D:\a\r1\a_Pi Regression\TestApp.sln 2023-06-05T10:52:01.9698608Z Checking file D:\a\r1\a_Pi Regression\README.md 2023-06-05T10:52:01.9698967Z Checking file D:\a\r1\a_Pi Regression\xml_to_nunit.xslt Locally this is finding the downloaded report, in azure it is not. Has anyone got any ideas on what I am missing please?

Thanks in advance.

Kev

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,381 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
331 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 26,646 Reputation points Microsoft Vendor
    2023-06-07T09:50:18.0433333+00:00

    Hi @Kev Martin

    Welcome to Microsoft Q&A! 

    Azure DevOps is currently not supported in the Microsoft Q&A, the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask in the dedicated Azure DevOps forum over here:

    https://developercommunity.visualstudio.com/report?space=21&entry=problem

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     

    0 comments No comments

0 additional answers

Sort by: Most helpful