Xamarin.UITest are not running through command line

I am running below command in jenkins to run my test on simulator or real device:-
** mono /Nunit-2.6.4/bin/nunit-console.exe <path/to/uitest-assembly.dll>**

it use to work but now I am getting below error :-

_Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
OS Version: Unix 15.5.0.0
CLR Version: 4.0.30319.42000 ( Mono 4.0 ( 4.4.1 (mono-4.4.0-branch-c7sr0/4747417 Mon Jun 20 15:43:48 EDT 2016) ) )

ProcessModel: Default DomainUsage: Single
Execution Runtime: mono-4.0
Could not load file or assembly or one of its dependencies.
_
I also tried Nunit-Console that come with xamarin but no luck. Getting below error :-

/Library/Frameworks/Mono.framework/Commands/nunit-console4 <path/to/uitest-assembly.dll>
NUnit version 2.4.8
_Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
OS Version: Unix 15.6.0.0
CLR Version: 4.0.30319.42000 ( 4.4.1 (mono-4.4.0-branch-c7sr0/4747417 Mon Jun 20 15:43:48 EDT 2016) )

Unhandled Exception:
System.TypeLoadException: Could not load type Xamarin.UITest.Platform, Xamarin.UITest, Version=1.3.7.0, Culture=neutral, PublicKeyToken=null while decoding custom attribute_


Please suggest how to fix it

Posts

  • NuninzNuninz USMember ✭✭

    how does your AppInitializer class looks like? I'm running the same command through Jenkins and the tests run fine

  • SwatiJainSwatiJain USMember ✭✭

    Currently I am trying to run tests on real device but with simulator also it is not working.
    Below is the code for App Initializer for Simulator :
    public class AppInitializer
    {
    public static IApp StartApp (Platform platform)
    {
    if (platform == Platform.Android) {
    return ConfigureApp.Android.StartApp ();
    }
    return ConfigureApp.iOS
    .EnableLocalScreenshots()
    .AppBundle(".app")
    .DeviceIdentifier("664A8A0C-6B89-44D9-8318-3A86BC31507")
    .StartApp();

        }
    

    For Real device:-
    return ConfigureApp.iOS.InstalledApp("com.kcura.relativity")
    .EnableLocalScreenshots()
    .DeviceIdentifier("C28B00AC-7046-52BA-B6EF-F7F2DAE9CA66")
    .StartApp (AppDataMode.DoNotClear);

Sign In or Register to comment.