Xamarin.UITest Tests not working only on real Android devices

611 views Asked by At

I'm new to XamarinUITest and I am having trouble running it on real devices locally (in preparation for AppCenter Test).

When I run it using an Android emulator, the test runs smoothly, passes and completes.

When I run it on a real device connected to my machine (OnePlus 5T) I get the following issues:

      Message: 
System.Exception : Post to endpoint '/ping' failed after 100 retries. No http result received

  Stack Trace: 
AppInitializer.StartApp(Platform platform) line 24
Login.BeforeEachTest() line 25

  Standard Output: 
Full log file: C:\Users\Steve\AppData\Local\Temp\uitest\log-2021-11-25_13-54-49-953.txt
Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.
Android test running Xamarin.UITest version: 3.2.3
Initializing Android app on device 3acaec7 with apk: C:\Users\Steve\source\repos\MyTestApp\MyTestApp.Android\bin\Dev\com.mytestapp.dev-Signed.apk
Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.
Signing apk with Xamarin keystore.

I have internet permissions on in my AndroidManifest.xml file.

AppInitializer

public static IApp StartApp(Platform platform)
{
    try
    {
        if (platform == Platform.Android)
            return ConfigureApp.Android.ApkFile(@"C:\Users\Steve\source\repos\MyTestApp\MyTestApp.Android\bin\Dev\com.mytestapp.dev-Signed.apk").StartApp();
        else
            return ConfigureApp.iOS.StartApp();
    }
    catch(Exception ex)
    {
        throw(ex);
    }
}

I get this same issue if I try upload it to AppCenter. If I run the app when the APK file is already on the device then the test loading indicator keeps spinning forever.

I have tried .InstalledApp() instead and also had no luck on real devices. This is v important so I really appreciate everyone chimming in. Thanks.

0

There are 0 answers