Forum Visual Studio

Timeout exception while launching Android app

Hi,

I am getting Timeout exception for many apk files.
Apk is being installed and getting launched using below code

app = ConfigureApp.Android.ApkFile(path).StartApp();

Then it is throwing Timeout exception.

Note: I tried with "com.xamarin.XamStore.apk" and it is also giving same error.

Please see the error trace below

------ Discover test started ------
Unable to load types from the test source 'C:\Users\abc\documents\visual studio 2013\Projects\Demo\Demo\bin\Debug\Demo.dll'. Some or all of the tests in this source may not be discovered. If you are running unit tests for Windows Store apps and referencing custom WinMD type then please visit http://go.microsoft.com/fwlink/?LinkId=238340 for more info. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.
.
NUnit VS Adapter 2.0.0.0 discovering tests is started
NUnit VS Adapter 2.0.0.0 discovering test is finished
SpecRun Evaluation Mode: Please purchase at http://specrun.com to remove test execution delay.
An exception occurred while test discoverer 'SpecRunTestDiscoverer' was loading tests. Exception: Could not load file or assembly 'Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
[xUnit.net 00:00:01.1248206] Skipping: Demo (could not find dependent assembly 'xunit.core, Version=2.0.0')
========== Discover test finished: 4 found (0:00:02.6308751) ==========
------ Run test started ------
NUnit VS Adapter 2.0.0.0 executing tests is started
Loading tests from C:\Users\abc\documents\visual studio 2013\Projects\Demo\Demo\bin\Debug\Demo.dll
Run started: C:\Users\abc\documents\visual studio 2013\Projects\Demo\Demo\bin\Debug\Demo.dll
Full log file: C:\Users\abc\AppData\Local\Temp\uitest\log-2015-08-29_02-21-08-727.txt
Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.
Android test running Xamarin.UITest version: 1.0.0
Running in unactivated mode. Test run will be restricted to simulators for a maximum duration of 15 minutes. The full version is available for Xamarin Test Cloud customers, for more information contact [email protected]
Initializing Android app on device emulator-5554 with apk: C:\Users\abc\documents\visual studio 2013\Projects\Demo\Demo\bin\Debug\TestApp.apk
Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.
Signing apk with internal keystore.
Exceptions while waiting:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at Xamarin.UITest.Shared.Http.HttpClient.GetResponseViaRequest(HttpWebRequest request)
at Xamarin.UITest.Shared.Http.HttpClient.Post(String endpoint, String arguments, ExceptionPolicy exceptionPolicy, Nullable1 timeOut) at Xamarin.UITest.Android.AndroidGestures.Query[T](ITokenContainer query, Object[] args, String methodName) at Xamarin.UITest.Android.AndroidGestures.Query(AppQuery query) at Xamarin.UITest.Android.AndroidApp.<AndroidApp>m__1() at Xamarin.UITest.Shared.WaitForHelper.WaitFor(Func1 predicate, String timeoutMessage, Nullable1 timeout, Nullable1 retryFrequency, Nullable`1 postTimeout)
NUnit VS Adapter 2.0.0.0 executing tests is finished
========== Run test finished: 1 run (0:02:07.7763074) ==========

Please help me in resolving the issue and let me know if you need some more info on the problem.

Note:

  1. I am using Visual Studio 2103 Ultimate, other setup is done including "Xamarin.UITest", to confirm this I tried with different apps and I was able to automate and test it on Emulator but many apk's are giving above mentioned exception

Best Regards,
Sunil

Sign In or Register to comment.