Xamarin Studio UITest

EmyMa341EmyMa341 USMember ✭✭
edited April 2016 in Xamarin.iOS

I am trying to run the UITest iOS project in Xamarin studio, I am getting this error, UI Automation is enabled in the simulator. My target project was created in visual studio. Unfortunately iOS UITest can't be tested on visual studio IDE.

SetUp : System.Exception : Instruments failed to start the app. Stack trace: at Xamarin.UITest.iOS.Instruments.WaitForInstruments (Xamarin.UITest.Shared.Processes.RunningProcess instrumentsProcess) <0x4645a50 + 0x005e3> in <filename unknown>:0 at Xamarin.UITest.iOS.Instruments.StartInstrumentsInternal (System.String targetApplication, iOSRunType runType, System.String deviceId, System.String runLoopPath, AppDataMode appDataMode, System.Predicate 1 dropLine) <0x4641d50 + 0x0025b> in <filename unknown>:0 at Xamarin.UITest.iOS.Instruments.StartInstrumentsHostLoop (System.String targetApplication, iOSRunType runType, System.String deviceId, System.String fifoPath, AppDataMode appDataMode) <0x46415f8 + 0x000ff> in <filename unknown>:0 at Xamarin.UITest.iOS.iOSAppLauncher.StartUsingHostStrategy (System.String targetApplication, Xamarin.UITest.iOS.Instruments instruments, iOSRunType runType, System.String deviceIdentifier, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Uri deviceUri, Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder, AppDataMode appDataMode) <0x4641410 + 0x000ab> in <filename unknown>:0 at Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulatorInternal (System.String application, Xamarin.UITest.iOS.Instruments instruments, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Uri deviceUri, Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder, AppDataMode appDataMode, System.String deviceIdentifier) <0x463e908 + 0x001cb> in <filename unknown>:0 at Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulator (Xamarin.UITest.Shared.iOS.AppBundle appBundle, Xamarin.UITest.iOS.Instruments instruments, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Uri deviceUri, Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder, AppDataMode appDataMode, System.String deviceIdentifier) <0x463c530 + 0x001ef> in <filename unknown>:0 at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient) <0x44e87a0 + 0x00283> in <filename unknown>:0 at Xamarin.UITest.iOS.iOSApp..ctor (IiOSAppConfiguration appConfiguration) <0x375ad30 + 0x00b83> in <filename unknown>:0 at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (AppDataMode appDataMode) <0x3757e68 + 0x00063> in <filename unknown>:0 at myplano.iOS.UITests.Tests.BeforeEachTest () [0x00012] in /Users/makhan/Downloads/xamarin_myplano/myplano.iOS.UITests/Tests.cs:37 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.2.3/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.3/mcs/class/corlib/System.Reflection/MonoMethod.cs:295

I am using following code to connect to my target application because using reference thing its grayed out "Target no comptatiblt"

app = ConfigureApp .iOS // TODO: Update this path to point to your iOS app and uncomment the // code if the app is not included in the solution. .AppBundle ("../../../myplano/myplano.iOS/bin/iPhoneSimulator/Debug/myplanoiOS.app") .StartApp ();

I would appreciate if someone had the same issue. I tried many solutions like opening the Instruments.app and selecting the device and then clicking on record button but still no fix.

UPDATE: If I clean and rebuilt the project and then run then I get following error, I am testing this on local device.

SetUp : System.Exception : Unable to run on a physical device without activation.
The full version is available for Xamarin Test Cloud customers, for more information contact [email protected]
If you are already a Xamarin Test Cloud customer, you can provide your api key in one of the following ways:
* Adding it ConfigureApp using the ApiKey method
* Setting the XTC_API_KEY environment variable
* Adding the following attribute to your Properties/AssemblyInfo.cs file: [assembly: Xamarin.UITest.TestCloudApiKey(YOUR_API_KEY)]
* Place an xtc-api-key file containing your api key in an upstream directory from the test assembly.

After this on 2nd build I get instruments error

SetUp : System.Exception : Instruments failed to start the app.

Best Answer

Answers

Sign In or Register to comment.