2gis / Winium.Mobile

Winium.Mobile is Selenium Remote WebDriver implementation for automated testing of Windows StoreApps and Silverlight apps, tested on emulators (currently only Windows Phone/Mobile apps are supported).
Mozilla Public License 2.0
51 stars 29 forks source link

Winium server #147

Closed naix86 closed 8 years ago

naix86 commented 8 years ago

Hi,

Why is it that I keep getting server error when trying to the my test? telnet and http://localhost:9999 communicates with the server but not when running the test.

I am using VM Fusion

NickAb commented 8 years ago

I will need more info to debug the problem.

Could you please provide error with stack-trace (if available) and provide logs that are written by driver (I recommend to start driver with verbose flag option).

naix86 commented 8 years ago
15:04:28 [DEBUG] Waiting for a connection...
15:04:28 [DEBUG] ACCEPTED REQUEST POST /session HTTP/1.1
15:04:28 [INFO] COMMAND newSession
{
  "desiredCapabilities": {
    "devicename": "Mobile Emulator 10.0.10586.0 WVGA 4 inch 512MB",
    "app": "C:\\Users\\xxx\\Documents\\xxx\\Sdk\\xxx\\bin\\x86\\Debug\\UWP_1.0.0.0_x86_Debug.appx"
  }
}
15:04:29 [DEBUG] RESPONSE:
OK:
{
  "sessionId": "2b03e3b5-40c7-486c-98b7-f2cae0d0a8ea",
  "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": "The data necessary to complete this operation is not yet available.\r\n"
  }
}
15:04:29 [DEBUG] Client closed

15:04:29 [DEBUG] Waiting for a connection...
NickAb commented 8 years ago

Are you able to launch emulator and deploy app manually using Windows Phone Application Deployment tool?

naix86 commented 8 years ago

For this, I can't because "WinAppDeployCmd devices" is not capturing the device BUT i can run the automation after 10 retries.

NickAb commented 8 years ago

WinAppDeployCmd devices does not list a particular device or does not list any devices?

naix86 commented 8 years ago

Does not list any

NickAb commented 8 years ago

So, once in ten times are are able to start emulator and run tests. What about other times, does emulator start as expected or does it fail?

You might experience some problems if you run your emulators inside a windows, that is running inside VM Fusion or Parallels with nested emulation. In such case you are basically running a VM inside a VM, because emulators are Hyper-V virtual machines. But so far I had ok experience with nested virtualisation at home and at work. At work we run server with esxi that runs a Windows VMs that we use for Windows Phone automation, but it requires some good hardware.

naix86 commented 8 years ago

Hi Nick,

the other times it just launch the emulator without success in deploying the application.

I'm thinking along the same line of nested VMs too; Hyper-V and VM Fusion. But just no concrete proof.

Are there anyway to resolve this?

NickAb commented 8 years ago

You can try getting any results from WinAppDeploy. If it exhibits the same behaviour (working unreliable), then it will be hard to do anything. You can try adding RAM and CPU to your virtual machine. You can try restarting Hyper-V service, but I don't think it will have any effect.

naix86 commented 8 years ago

hmm... i did them. i can't use WinAppDeploy because it just simply not giving me ip to the emulator. oh well.

NickAb commented 8 years ago

You can try WinAppDeploy UI app. If you have Visual Studio installed, does it always succeed to deploy the app to emulator?

Also, if you have access to Windows that runs on bare metal, not inside VM Fusion, you can try setting up and running tests on it to make sure that the problem is related to the setup, not to the app itself or the driver.

naix86 commented 8 years ago

Will try the Windows bare. thank you !