Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin UITest: DeviceAgent is being installed but not the .APP

R2DR2D Member ✭✭

Hi guys,

I am currently working on a project using Xamarin UItest to test the IOS app. I configured the solution as below. But I am getting error when executing a test case on a physical device as well as the virtual device. I was wondering what I am doing wrong with the configuration, or am I missing something? The DeviceAgent is being installed, but after that nothing happens.

Solution

using System;
using System.Threading.Tasks;
using Xamarin.UITest;
using Xamarin.UITest.Queries;

namespace Testframework_DitApp
{

public class AppInitializer
{

    public static IApp StartApp(Platform platform)
    {

        if (platform == Platform.iOS)
        {
            return ConfigureApp
                .iOS
                .Debug()
                .EnableLocalScreenshots()
                .DeviceIdentifier("8b7937ef87210a797fc4fa0750e3c62d194bd5b1")
                .InstalledApp("/Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.app")
                .StartApp();           
        }
        return ConfigureApp.iOS.InstalledApp("/Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.ipa").DeviceIdentifier("8b7937ef87210a797fc4fa0750e3c62d194bd5b1").StartApp();
       }
}

}

Logfile

Full log file: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/log-2018-08-30_09-40-59-050.txt

iOS test running Xamarin.UITest version: 2.2.5

Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.

Artifact folder: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-0482DFE3EAA4B590406DC5DEDBA3EAF6BB72CD5E

Running command. { Path: "chmod", Arguments: "a+x /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-0482DFE3EAA4B590406DC5DEDBA3EAF6BB72CD5E/20021/idevice-tools/iappdata", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Running command. { Path: "chmod", Arguments: "a+x /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-0482DFE3EAA4B590406DC5DEDBA3EAF6BB72CD5E/20021/idevice-tools/iproxy", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Artifact folder: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-98F82CFEDF0FB026556412C4B9E68EF3BED6D9ED

Starting app. { BundleId: "/Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.app" }

Running command. { Path: "ps", Arguments: "-xww -o pid,user,args", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Killing portforwarding process with PID 19419

Running command. { Path: "ps", Arguments: "-xww -o pid,user,args", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Killing portforwarding process with PID 19421

Finished with exit code 0 in 174 ms.

Running command. { Path: "ps", Arguments: "-xww -o pid,user,args", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Starting process. { Path: "/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-0482DFE3EAA4B590406DC5DEDBA3EAF6BB72CD5E/idevice-tools/iproxy", Arguments: "37265 37265 8b7937ef87210a797fc4fa0750e3c62d194bd5b1", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Running command. { Path: "ps", Arguments: "-xww -o pid,user,args", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Starting process. { Path: "/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/uitest/a-0482DFE3EAA4B590406DC5DEDBA3EAF6BB72CD5E/idevice-tools/iproxy", Arguments: "27753 27753 8b7937ef87210a797fc4fa0750e3c62d194bd5b1", CurrentDirectory: "/Users/R/Stack/Developer/Testframework_DitApp2/Testframework_DitApp/bin/Debug" }

Clearing app data.

1 - ClearData:
bundleId: /Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.app
deviceId: 8b7937ef87210a797fc4fa0750e3c62d194bd5b1

HTTP POST { Url: { AbsolutePath: "/exit", AbsoluteUri: , LocalPath: "/exit", Authority: "127.0.0.1:37265", HostNameType: IPv4, IsDefaultPort: False, IsFile: False, IsLoopback: True, PathAndQuery: "/exit", Segments: [ "/", "exit" ], IsUnc: False, Host: "127.0.0.1", Port: 37265, Query: "", Fragment: "", Scheme: "http", OriginalString: , DnsSafeHost: "127.0.0.1", IdnHost: "127.0.0.1", IsAbsoluteUri: True, UserEscaped: False, UserInfo: "" } }

Running: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager is-installed /Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.app -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1

POST Complete { StatusCode: 0, StatusDescription: "A task was canceled.", ResponseHeaders: "", Content: "" }

Exit code '2' received from '/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager is-installed /Users/R/Stack/Developer/Testframework_DitApp/Payload/Prod.app -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1'
false

3 - LaunchTestAsync:
deviceId: 8b7937ef87210a797fc4fa0750e3c62d194bd5b1

4 - HTTP GET

4 - HTTP GET complete

DeviceAgent '1533657035' not found, launching

5 - HTTP DELETE

5 - HTTP DELETE complete

DeviceAgent delete session response: RequestTimeout -

6 - HTTP POST

6 - HTTP POST complete

DeviceAgent shutdown response: RequestTimeout -

7 - HTTP GET

Running: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager install "/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/ipa/DeviceAgent-Runner.app" -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1

Exit code '0' received from '/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager install "/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/ipa/DeviceAgent-Runner.app" -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1'

Running: /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager is-installed /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/ipa/DeviceAgent-Runner.app -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1

Exit code '0' received from '/var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/bin/iOSDeviceManager is-installed /var/folders/1g/9ql9t0x558n9kf2ys8c5kks40000gn/T/xdb/DeviceAgent.iOS.Dependencies/c298adc2fd95518dc464c6d9138a9c6d/ipa/DeviceAgent-Runner.app -d 8b7937ef87210a797fc4fa0750e3c62d194bd5b1'

8 - HTTP GET

3 - Unsuccessful

Sign In or Register to comment.