Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99401

How do I open a file on remote mac from automation tests on PC

$
0
0

Using VS/C#/Selenium/.Net 8.0 for a large set of regression tests which work fine on Windows with Chrome, Edge and Firefox on Windows.

However not so well on Mac with Safari with which we are using RemoteWebDriver and connecting to a local Mac Mini. We have a few tests which download reports to the Downloads folder on the Mac which we then want to open to validate the contents.

As I have said this all works fine on Windows and as part of a pipeline in Azure but on the Mac tests I cannot locate the folder in code. I can browse to it on the Mac and see the downloaded files but not from the test suite.

Below is an example of what has been tried

protected static string DownloadPath { get; set; } = @"Downloads\\";string[] filePaths = Directory.GetFiles(DownloadPath)

We have also tried different values in DownloadPath but none will locate the actual folder. So can anyone give me any hints on how to achieve this please.

Thanks for the comments so far, however the problem has now changed slightly, below is my code now to try and reach the folder on the Mac which has the IP as shown below.

        var DownloadPath = "//192.168.0.12/Downloads/";        string[] filePaths = Directory.GetFiles(DownloadPath);

The error I now get isenter image description here

So how do I add credentials please.


Viewing all articles
Browse latest Browse all 99401

Trending Articles