2gis / winphonedriver

DEPRECATED Please see https://github.com/2gis/Winium.Mobile for latests releases. Selenium Driver for automated testing of Windows Phone 8.1 Silverlight applications.
14 stars 3 forks source link

Error:"Could not get Virtual Machine for Emulator 8.1 WVGA 4 inch 512MB" #78

Open padmaja2812 opened 8 years ago

padmaja2812 commented 8 years ago

I am trying to setup winium on a VM. App is getting installed on emulator but outer driver is giving about exception and hence remotedriver value is null. When i looked into outerdriver code in EmulatorFactory.cs in GetVm() vm = wmiFactory.GetVirtualMachine(fullName); //returning Null hence throwing exception. Is there any specific setting for running Winium on a VM ? Please help me out with this issue.

Thanks Padmaja

NickAb commented 8 years ago

Are you using English version of Windows or an localised version?

Could you please run WinAppDeployCmd.exe devices from the location where Windows Application Deployment tool is installed. Also, please provide driver logs so that it is easier to pinpoint the problem.

padmaja2812 commented 8 years ago

Hi Nick, Below is output for language and the devices in WinAppDeployCmd.exe devices .

C:\Program Files (x86)\Windows Kits\10\bin\x86>dism /online /get-intl

Deployment Image Servicing and Management tool
Version: 10.0.10586.0

Image Version: 10.0.10586.0

Reporting online international settings.

Default system UI language : en-US
System locale : en-US
Default time zone : India Standard Time
Active keyboard(s) : 0409:00000409
Keyboard layered driver : PC/AT Enhanced Keyboard (101/102-Key)

*Installed language(s): en-US*
*  Type : Fully localized language.*

The operation completed successfully.

C:\Program Files (x86)\Windows Kits\10\bin\x86>WinAppDeployCmd.exe devices Windows App Deployment Tool Version 10.0.0.0 Copyright (c) Microsoft Corporation. All rights reserved.

Discovering devices... IP Address GUID Model/Name Done.

Log for WiniumPhone.OuterServer

 14:05:51 [DEBUG] Waiting for a connection...
14:06:00 [DEBUG] ACCEPTED REQUEST POST /session HTTP/1.1
14:06:00 [INFO] COMMAND newSession
{"desiredCapabilities":{"app":"C:\\Stargate_Windows\\Application\\SanitySuite.xap","DeviceName":"Emulator
8.1 WVGA 4 inch 512MB"}}
14:07:03 [INFO] Target emulator: 'Emulator 8.1 WVGA 4 inch 512MB'
14:07:19 [INFO] KonyWP7 was successfully deployed using
Microsoft.Phone.Tools.Deploy
14:07:27 [INFO] Emulator 'Emulator 8.1 WVGA 4 inch 512MB.admin' not found
in cache. Requesting WMI.
14:07:35 [INFO] Emulator 'Emulator 8.1 WVGA 4 inch 512MB.admin' not found
in cache. Requesting WMI.
14:07:42 [DEBUG] RESPONSE:
OK:
{
  "sessionId": "AwesomeSession",
  "status": 13,
  "value": {
    "error": "unknown error",
    "stacktrace": "   at
Winium.Mobile.Connectivity.Emulator.EmulatorController..ctor(String
emulatorName)\r\n   at
WindowsPhoneDriver.OuterDriver.Automator.Automator.CreateEmulatorController(Boolean
withFallback) in
C:\\Stargate_Windows\\WiniumPhone8.1\\winphonedriver\\WindowsPhoneDriver\\WindowsPhoneDriver.OuterDriver\\Automator\\Automator.cs:line
127\r\n   at
WindowsPhoneDriver.OuterDriver.CommandExecutors.NewSessionExecutor.InitializeApplication(Boolean
debugDoNotDeploy) in
C:\\Stargate_Windows\\WiniumPhone8.1\\winphonedriver\\WindowsPhoneDriver\\WindowsPhoneDriver.OuterDriver\\CommandExecutors\\NewSessionExecutor.cs:line
81\r\n   at
WindowsPhoneDriver.OuterDriver.CommandExecutors.NewSessionExecutor.DoImpl()
in
C:\\Stargate_Windows\\WiniumPhone8.1\\winphonedriver\\WindowsPhoneDriver\\WindowsPhoneDriver.OuterDriver\\CommandExecutors\\NewSessionExecutor.cs:line
30\r\n   at
WindowsPhoneDriver.OuterDriver.CommandExecutors.CommandExecutorBase.Do() in
C:\\Stargate_Windows\\WiniumPhone8.1\\winphonedriver\\WindowsPhoneDriver\\WindowsPhoneDriver.OuterDriver\\CommandExecutors\\CommandExecutorBase.cs:line
45",
    "message": "Could not get Virtual Machine for Emulator 8.1 WVGA 4 inch
512MB"
  }
}

Thanks Padmaja

On 1 August 2016 at 18:30, Nick Abalov notifications@github.com wrote:

Are you using English version of Windows or an localised version?

Could you please run WinAppDeployCmd.exe devices from the location where Windows Application Deployment tool is installed. Also, please provide driver logs so that it is easier to pinpoint the problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/2gis/winphonedriver/issues/78#issuecomment-236573771, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLuhOcBwO35_MzaUOXwkEgEpx3l4agmks5qbe30gaJpZM4JZXah .

NickAb commented 8 years ago

Could you please run WinAppDeployCmd from 8.1 kit? (as you are trying to deploy to 8.1 emulator). It should print out list of devices, emulator you are trying to deploy should be among the items on the list.

Also, try running Hyper-V Manager and checking if Emulator 8.1 WVGA 4 inch 512MB.admin does exists and named exactly as above.

padmaja2812 commented 8 years ago

There is not such exe in 8.1 kit.Is there any other way i can find out same?

I have checked in Hyper-v this emulator is running.

Thanks Padmaja

On 2 August 2016 at 06:56, Nick Abalov notifications@github.com wrote:

Could you please run WinAppDeployCmd from 8.1 kit? (as you are trying to deploy to 8.1 emulator). It should print out list of devices, emulator you are trying to deploy should be among the items on the list.

Also, try running Hyper-V Manager and checking if Emulator 8.1 WVGA 4 inch 512MB.admin does exists and named exactly as above.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/2gis/winphonedriver/issues/78#issuecomment-236764591, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLuhBM4MzpzTolMHcL7F1ba5jtD9oGvks5qbpywgaJpZM4JZXah .

NickAb commented 8 years ago

My mistake, in 8.1 it is called AppDeployCmd.exe. It should be located at "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeploy.exe"

padmaja2812 commented 8 years ago

Hi Nick, Sorry for the delay.

C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy>AppDeployCmd.exe /EnumerateDevices

Device Index Device Name


0 Device 1 Mobile Emulator 10.0.10586.0 WVGA 4 inch 512MB 2 Mobile Emulator 10.0.10586.0 WVGA 4 inch 1GB 3 Mobile Emulator 10.0.10586.0 WXGA 4.5 inch 1GB 4 Mobile Emulator 10.0.10586.0 720p 5 inch 1GB 5 Mobile Emulator 10.0.10586.0 1080p 6 inch 2GB 6 Mobile Emulator 10.0.10586.0 QHD 5.2 inch 3GB 7 * Emulator 8.1 WVGA 4 inch 512MB* 8 Emulator 8.1 WVGA 4 inch 9 Emulator 8.1 WXGA 4.5 inch 10 Emulator 8.1 720P 4.7 inch 11 Emulator 8.1 1080P 5.5 inch 12 Emulator 8.1 1080P 6 inch Done.

I am able to get the emulator with this command. Is there any other setting which i need to enable?

Thanks Padmaja

On 2 August 2016 at 12:05, Nick Abalov notifications@github.com wrote:

My mistake, in 8.1 it is called AppDeployCmd.exe. It should be located at"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\ AppDeploy.exe"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/2gis/winphonedriver/issues/78#issuecomment-236813368, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLuhIT69FhRoRsMyJde7tcJgamKhdcMks5qbuUxgaJpZM4JZXah .

NickAb commented 8 years ago

After trying to run tests, do you have Emulator 8.1 WVGA 4 inch 512MB.admin in the list of virtual machines in Hyper-V Manager?

padmaja2812 commented 8 years ago

Yes it is showing.

On Aug 10, 2016 12:22 PM, "Nick Abalov" notifications@github.com wrote:

After trying to run tests, do you have Emulator 8.1 WVGA 4 inch 512MB.admin in the list of virtual machines in Hyper-V Manager?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/2gis/winphonedriver/issues/78#issuecomment-238780760, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLuhGVeMcP5N9xvlNf5TtWxze7Gqq1Qks5qeXUhgaJpZM4JZXah .

NickAb commented 8 years ago

Does the emulator has exactly .admin at the end of the name in Hyper-V Manager? Please make sure that both emulator and driver are started from the same user. Try closing the emulator and restarting tests, or pick another emulator name and see what happens. This seems to be unusual situation.