Winium.Mobile icon indicating copy to clipboard operation
Winium.Mobile copied to clipboard

Could not connect to the InnerServer issue in Windows10 application on Windows 10 host system

Open Pranodayd opened this issue 7 years ago • 14 comments

Hello @NickAb I am using Windows 10 host machine,have instrumented my windows 10 application using Winium.Innerserver(1.6.2) properly.I have set Internet(Client&Server) capability as well.Have tested it succesfully from Windows 8 host system.But when I try to deploy same application using Winium.Inspector on Windows10 host system,it gets deployed suceessfully.But Winium.inspector is unable to connect to the Winium.Inerserver started with my application. I am getting an error:Unble to connect to the innerserver.

Please help me in resolving this. Thanks and Regards, Pranoday

Pranodayd avatar Aug 18 '16 10:08 Pranodayd

Have you tried enabling Developer mode? https://msdn.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development

NickAb avatar Aug 19 '16 05:08 NickAb

@NickAb .I have developer mode enabled in my Windows emulator as well as on Windows 10 host system.I tried with disabling Firewall on my Windows 10 host system as well.But nothing could work.

Pranodayd avatar Aug 19 '16 06:08 Pranodayd

@NickAb I have also confirmed following things: 1.My application is instrumented with latest Winium.StoreAppps.Inerserver(1.6.2) 2.I don't have any other service running on port 9998 using which Winium.StoreApps.Driver communicates to InnerServer. Everything looks fine but still unable to connect to Winium.Innerserver

Pranodayd avatar Aug 19 '16 06:08 Pranodayd

Just to clarify, it works (you can run tests) on Windows 8, but does not work on Windows 10 host system. Is it right?

Note that InnerServer does not listen on 9998 since v1.3.0, it uses dynamic port. It binds to any free port and writes the port number into .Winium.StoreApps.ConnectionInformation.json file in app's temporary storage.

NickAb avatar Aug 19 '16 10:08 NickAb

It works on Windows 8.I can run tests on Windows 8 host system.Problem is only on Windows 10 host system.What could be the possible reason?

Pranodayd avatar Aug 19 '16 10:08 Pranodayd

@NickAb Any idea about this?

Pranodayd avatar Aug 22 '16 05:08 Pranodayd

Please provide log output of the driver launched with --verbose flag. You can use --log-pathfile LOG.txt to log directly to file and copy paste into reply.

Also, could you please try the following steps?

  1. Install IsoStoreSpy https://isostorespy.codeplex.com

  2. Deploy the app under test to emulator

  3. Using IsoStoreSpy locate .Winium.StoreApps.ConnectionInformation.json file in temp storage of the app

  4. Note the port number specified in the json file

  5. Try sending HTTP POST request to http://localhost:<port> with following body

    {
        "name": "ping",
        "parameters": {}
    }
    

It should respond with <pong>.

NickAb avatar Aug 22 '16 07:08 NickAb

@NickAb I will try and get back to you with my findings.

Pranodayd avatar Aug 22 '16 13:08 Pranodayd

@NickAb Please see the error I am getting. image

Pranodayd avatar Nov 10 '16 10:11 Pranodayd

Also please see the log report I am getting. 15:44:21 [INFO] Winium.StoreApps.Driver, Version: 1.6.2.15006, Revision: efb0b81ea01243d898fcba88f99ca7513b7925ac 15:44:21 [INFO] RemoteWebDriver instances should connect to: http://localhost:10001/ 15:44:21 [DEBUG] Waiting for a connection... 15:44:39 [DEBUG] ACCEPTED REQUEST POST /session HTTP/1.1 15:44:39 [INFO] COMMAND newSession { "desiredCapabilities": { "app": "D:\Magic\UP2\RIAModules\Windows10Mobile\MagicDev\MagicApp_1.0.0.0_x86.appx" } } 15:44:43 [INFO] Target emulator: 'Mobile Emulator 10.0.10586.0 720p 5 inch 1GB' 15:44:44 [INFO] my.application was successfully deployed using Microsoft.Phone.Tools.Deploy 15:44:44 [INFO] Emulator 'Mobile Emulator 10.0.10586.0 720p 5 inch 1GB.krishanc' not found in cache. Requesting WMI. 15:45:40 [DEBUG] Connected in 50.4305935 seconds. 15:45:40 [DEBUG] RESPONSE: OK: { "sessionId": "ab4ee0e5-d0d1-47fc-b11b-33c3d09a6d16", "status": 33, "value": { "error": "session not created", "stacktrace": " at Winium.StoreApps.Driver.CommandExecutors.NewSessionExecutor.DoImpl() in d:\Projects\windows-universal-app-driver\Winium\Winium.StoreApps.Driver\CommandExecutors\NewSessionExecutor.cs:line 38\r\n at Winium.StoreApps.Driver.CommandExecutors.CommandExecutorBase.Do() in d:\Projects\windows-universal-app-driver\Winium\Winium.StoreApps.Driver\CommandExecutors\CommandExecutorBase.cs:line 42", "message": "Could not connect to the InnerServer." } } 15:45:40 [DEBUG] Client closed

15:45:40 [DEBUG] Waiting for a connection...

Pranodayd avatar Nov 10 '16 10:11 Pranodayd

  1. Please check if you correctly embedded InnerServer into your application. You should call AutomationServer.Instance.InitializeAndStart(); from UI thread once your app starts.
  2. Check if you enabled Internet Server or Internet (Client & Server) capability in your app

NickAb avatar Nov 13 '16 19:11 NickAb

@NickAb I am unable to connect to the Winium.StoreApps.Innerserver eventhough I have followed the procedure you mentioned above correctly.Any help would be appreciated.

Thanks

Pranodayd avatar May 05 '17 08:05 Pranodayd

Could you please build and test app and run sample tests from our python suite?

This will help determinate if there is a problem specific to your app or system. Also, our test app prints out port number on which inner server listens, so you should be able to test connection manually.

NickAb avatar May 05 '17 08:05 NickAb

@NickAb I have built the .appx for test app but I am unable to run Python test on it.Can you please guide me on this?

Thanks and Regards, Pranoday

Pranodayd avatar Jun 02 '17 04:06 Pranodayd