screenshotxamarin.uitest

Xamarin.UITest Screenshot location


I've got a problem with Xamarin.UITest, specifically screenshot feature. It is not working as expected.

I'm trying to copy "created" screenshot to another directory, but I get the following error:

Message: System.IO.FileNotFoundException : Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\screenshot-1.png'.

I'm using this piece of code to copy image file:

var screen = app.Screenshot("Welcome screen.");
screen.CopyTo(@"C:\Users\someuser\Desktop\screenshotTest.png");

How to specify first path/location for screenshots, because the original path probably needs admin privileges, that I don't have.


Solution

  • Half solution to the problem: I downgraded NUnit from 3.11.0 to 2.7.0, so it works OK.