Forum Xamarin Test Cloud (Read Only)

Getting Error "System.NotSupportedException:The given path's format is not supported." Seeking Help

SajidSidiSajidSidi USUniversity ✭✭

Hello All,

I am new in Xamarin, and Trying to design basic Test Script, Right After clicking on 'Run All' on Test Explorer, I am Getting below Error while run basic test with Xamarin UITest *"System.NotSupportedException:The given path's format is not supported." * , I tired all possible solutions by Googling but did not get success.

Please let me know what exactly should be done here, I am just trying to Launch application which gets failed. I also suspect that there may some configuration issue in my machine or VS 2015. below is my Code and error StackTrace.

----------Test Code------------
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Queries;
using Xamarin.UITest.Android;
using System.Reflection;

namespace AndroidTestProject1
{
[TestFixture]
public class Tests
{
AndroidApp app;
private string apkname = "HelloWorld.Android.apk";

    [SetUp]
    public void BeforeEachTest()
    {
        try
        {
            Assembly ass = Assembly.GetExecutingAssembly();
            string path = System.IO.Path.GetDirectoryName(ass.Location) + "\\" + apkname;
            // TODO: If the Android app being tested is included in the solution then open
            // the Unit Tests window, right click Test Apps, select Add App Project
            // and select the app projects that should be tested.
            app = ConfigureApp
                .Android
                // TODO: Update this path to point to your Android app and uncomment the
                // code if the app is not included in the solution.
                .ApkFile(path)
                .StartApp();
        }
        catch (Exception ex)
        {

            throw;
        }

    }

    [Test]
    public void AppLaunches()
    {
        app.Repl();
      //  app.Screenshot("First screen.");
    }
}

}
------------END---------------------------

-------------StackTrace------------------------------
Test Name: AppLaunches
Test FullName: UITest2.Tests(Android).AppLaunches
Test Source: C:\Users\ssidi\documents\visual studio 2015\Projects\Hello\UITest2\Tests.cs : line 29
Test Outcome: Failed
Test Duration: 0:00:00.029

Result StackTrace:
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.DirectoryInfo.Init(String path, Boolean checkHost)
at System.IO.DirectoryInfo..ctor(String path)
at Xamarin.UITest.Shared.Dependencies.AndroidSdkTools.BuildAndroidSdkDependencies(PotentialLocation potentialLocation)
at Xamarin.UITest.Shared.Dependencies.AndroidSdkFinder.ResolveDependencies(PotentialLocation location)
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Xamarin.UITest.Shared.Dependencies.AndroidSdkFinder.GetTools()
at Xamarin.UITest.Shared.Android.DefaultAndroidFactory.BuildExecutor(IProcessRunner processRunner)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at UITest2.AppInitializer.StartApp(Platform platform) in C:\Users\ssidi\documents\visual studio 2015\Projects\Hello\UITest2\AppInitializer.cs:line 25
at UITest2.Tests.BeforeEachTest() in C:\Users\ssidi\documents\visual studio 2015\Projects\Hello\UITest2\Tests.cs:line 24
Result Message: SetUp : System.NotSupportedException : The given path's format is not supported.


Please help me to come out from this.

Answers

Sign In or Register to comment.