New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect to Windows 10 phone #35
Comments
Please try selenium==2.45.0. It should work. If it does, but you want to use newer selenium bindings, try https://github.com/2gis/Winium.StoreApps.CodedUi/tree/fix-empty-request-crash branch, it has a fix for such problem. |
Let me know if branched version helps with new bindings, I will merge it asap then. |
Hi Nick, Thanks i will try that solution and let you know the results. |
Yes, it should be fine. Link was added to reference the source for further reading. |
Hi Nick, I have some doubt, in the python sample code : command_executor='http://localhost:9998 we are using this command_executor right.. should we make sure that this is accessible from the browser of test machine (by installing IIS server and adding the binding for http and port 9998) ?? |
I am not sure what you mean by executor being accessible from browser. When you start driver it will bind to all interfaces, meaning that it can be accessed not only from localhost, but from other hosts in network. |
Hi Nick, I installed selenium 2.45.0 and executed the same code, but this time it is throwing error as "[WinError 10054] An existing connection was forcibly closed by the remote host" The error logs of Test_sample.py script are attached. Please can you tell me what has went wrong?? |
Hi Nick, I am able to connect with windows 10 phone, Thanks. |
This might be related to 2gis/Winium.Mobile#116 Please try workaround by removing dependencies as described in 2gis/Winium.Mobile#116 (comment) |
Hi Nick, Again i am facing same issue with error : "[WinError 10054] An existing connection was forcibly closed by the remote host" :( :( How can we make sure the connection will be consistent. Are there any pre-req to be taken care always before we start the script?? |
Hi Nick, Any solution for above problem?? |
Why your driver output says that it listens on port 9998? Have you modified listening port value? The driver itself should listen on port Port |
Hi Nick, The reason why is used port 9998 was, the registry settings was as follows: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IpOverUsbSdk\Winium] So here dword:0000270e means 9998 port, that is why i build the driver solution with that port. Soo.. according to you both registry and driver should be at port 9999 or just the driver at 9999 and registry at 9998 itself?? Can you please clarify? :) |
This is due to the fact that we actually have two servers. There is driver itself that is run on a host system. Your tests should connect to the port used by driver ( |
Hi Nick, I was able to connect successfully after following the above ports... Thanks.. :) Thanks. |
You can skip Also please see 2gis/Winium.Mobile#116 (comment) for workaround on UWP deployment. Another workaround that worked for me was to first deploy application using Visual Studio, so that dependencies like frameworks get deployed correctly, and then deploy appx only using the driver. |
Hi Nick, I tried the first workaround by removing the capability of app, but that did not work at all, i have attached the logs: The second approach of building the app with the framework dependencies cannot be done because we have to use the same UWP app without any changes :( Can you please provide me the modified code/winium solution which will not install the uwp app instead make use of the existing already installed UWP app on the mobile phone, so that we can interact with the installed UWP app through winium ?? Your help will be very much useful. Thanks. |
Attached logs suggest that there is still a problem with connecting to CodedUi server that is running on the device. Please make sure that you modified registry as required, Windows Phone device is connected via USB and can be deployed to using Visual studio or AppDeploy. Also, you should have developer mode enabled. |
Hi Nick, I am getting those connectivity errors ONLY when i remove the "app" from desired capabilities. Now i am trying to use your second work-around to deploy the UWP app in Visual Studio I am building/deploy the UWP app in visual studio 2015, what references related to winium should be added and where should we add so that the UWP app will install successfully through winium driver? Can you please provide me detailed steps during deploying UWP app where I should reference the winium related dlls? The main aim is i should be able to deploy the UWP appx on my windows 10 mobile phone using winium.storeapps.driver :) Thanks. |
Hi Nick, I am actually trying to deploy UWP app which was developed on Visual studio 2015.
-> Under "Winium.StoreApps.TestApp\AppPackages\UWPApp_ARM_ARM" path i have just placed my UWPApp_ARM_ARM.appx installer (tried by placing only this installer and this installer along with dependencies, where dependencies folder just had ARM dependencies). I am getting error as "selenium.common.exceptions.WebDriverException: Message: Unknown error: A packaging error prevented this application from installing." Can you please tell me what i am missing here?
** I just want to interact with the UWP app which is already installed on the windows phone so that i can skip the packaging error... :( |
Hi,
You should be able to skip app installation by removing `app` capability from your desired capabilities.
I do not know how to best handle packaging error, this is due to the fact that we use AppDeploy code that was written for Windows Phone 8.1. It works for basic apps like sample app, but might fail for complex apps because of dependencies.
Take a look at 2gis/Winium.Mobile#116 . You can try deploying your appx manually to the device before trying to test it.
From: sravv [mailto:notifications@github.com]
Sent: Monday, March 20, 2017 6:40 PM
To: 2gis/Winium.StoreApps.CodedUi <Winium.StoreApps.CodedUi@noreply.github.com>
Cc: Абалов Николай Владимирович <n.abalov@2Gis.ru>; Comment <comment@noreply.github.com>
Subject: Re: [2gis/Winium.StoreApps.CodedUi] Cannot connect to Windows 10 phone (#35)
Hi Nick,
I am actually trying to deploy UWP app which was developed on Visual studio 2015.
Trying to install UWP app which is "arm" (UWPApp_ARM.appx) package on windows 10 mobile phone.
The steps followed to run this was:
-> Built the Winium.Storeapps.driver.exe on visual studio 2013
-> In the Test Sample edited the desired capabilitires section as follows:
desired_capabilities = {
'deviceName': 'Device',
#'deviceName': 'Emulator',
'deviceIpAddress': 'localhost',
'locale': 'en-US',
'debugCodedUI': False,
'app': r"....\Winium.StoreApps.TestApp\AppPackages\UWPApp_ARM_ARM"
r"\UWPApp_ARM_ARM.appx"
}
-> Under "Winium.StoreApps.TestApp\AppPackages\UWPApp_ARM_ARM" path i have just placed my UWPApp_ARM_ARM.appx installer (tried by placing only this installer and this installer along with dependencies, where dependencies folder just had ARM dependencies).
-> Executed the driver and then the tests got the below error.
I am getting error as "selenium.common.exceptions.WebDriverException: Message: Unknown error: A packaging error prevented this application from installing."
Can you please tell me what i am missing here?
or
**
Is it possible to skip the installation of UWP app and directly start interacting with the installed UWP application on the windows 10 phone??
**
I just want to interact with the UWP app which is already installed on the windows phone so that i can skip the packaging error... :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#35 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA05s91xATP9o-zkUzFdIajUP8sPtESrks5rnmWngaJpZM4MSkDa>.
|
Hi Nick, Is it possible to give me the edited solution which skips the Installation of the UWP app and just proceeds to test the UI elements of the app? Because when i removed the app capabilities , i was just getting error for connection. If i give the app capablities i was getting error for installing the package. Thanks. |
Driver does skip app installation if If you get connection error when |
Hi Nick, The driver is running with port 9999 and the registry key is been set to 9998. Both mobile and the host system are enabled with developer mode. When i remove "app" from desired capability i am getting connection error and when the app capability is given i am getting package error .. :( And also how will the driver come to know that which app to launch and test ? (If we skip the installation of the app) |
In test sample linked in my previous comment we use tile id to open calendar app:
Could you please confirm if this sample works for you on following:
|
Good to know that :) But how to resolve that connection error? :( Thanks. |
Hi Nick, One more doubt how do i get the tile id of the UWP app developed by me? My mobile was not having the calendar app so may b it was failing to execute. Thanks. |
Hi Nick, I actually wanted it to work only on Mobile but not on emulators or with win 8.1 so i did not try with those. The mobile which i am using is not having calendar app maybe because of that its not able to launch and might be throwing "ERROR: Cannot connect to server ". So i am trying to see if i will be able to launch calculator app directly. By this i can confirm that if there is actually a connection failure. |
If it gives One way to get tile id is to use driver itself. You need to open home screen on your connected device or emulator. Then run a test case that contains a call to ps = self.driver.page_source
print(ps) The output would contain an xml with tiles from your home screen with associated ids. But this requires you to be able to connect to the server. I would suggest you to try it out with Windows Phone 8.1 emulator and then Windows 10 Mobile emulator if 8.1 worked. This will help debug the problem by narrowing scope. I just tested it on both Windows Phone 8.1 and Windows 10 Mobile emulators and it worked. I do not have access to Windows 10 Mobile device. |
Hi Nick, I am using Visual Studio 2013 Ultimate with update 3. Is this fine or should i use some other VS ?? |
VS 2013 Ultimate is what I've tested it on. So it should be ok. |
Hi Nick, I tried with windows 10 emulator( which i downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=53424 ). I buiild the solution and ran the winium.storeapps.driver.exe and then i executed the python script, i am getting the same error"Cannot connect to server" . Can you please tell me what is that i am missing here because on the emulator also it is not working :( . Thanks. |
For your information 10.106.132.51 is the ip address of my host machine. |
Have you enabled developer mode on your Windows 10 Desktop machine from which you run your tests? Also, I just updated master to include some logging for unhandled exceptions.
Once |
Hi Nick, I have enabled developer mode in my win10 desktop machine. If I download the code from the same link which I downloaded previously, will i get the latest master code? |
You can download latest source in master from this link https://github.com/2gis/Winium.StoreApps.CodedUi/archive/master.zip But you will need to build it yourself |
Hi Nick, I have downloaded the latest source from https://github.com/2gis/Winium.StoreApps.CodedUi/archive/master.zip and built it. I am attaching the driver logs and python logs, python script. Please let me know if you need anything else. |
Do you have Your logs are missing |
Hi Nick, I have taken the latest code given by you https://github.com/2gis/Winium.StoreApps.CodedUi/archive/master.zip and built it. And in the python script I added the CaptureLogs part and executed the driver/script. I am not getting any TestResults folder.. :( Anything i am missing here? The code link which you gave was updated? Thanks. |
Nick, |
Do not think so, but I do not know why it does not work for you, sorry. You can try setting |
I am running tests on Windows 10 mobile device using coded ui. Was able to build the solution to get Winium.Storeapps.driver.exe , executed this Winium.StoreApps.DRiver.exe and ran the test_sample.py script.
My mobile was not able to connect to the server.
I've added below keys
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IpOverUsb\Winium]
"DestinationAddress"="127.0.0.1"
"DestinationPort"=dword:0000270e
"LocalAddress"="127.0.0.1"
"LocalPort"=dword:0000270e
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IpOverUsbSdk\Winium]
"DestinationAddress"="127.0.0.1"
"DestinationPort"=dword:0000270e
"LocalAddress"="127.0.0.1"
"LocalPort"=dword:0000270e
I've also set deviceipaddress to 'localhost'
When i executed the driver and then the python script i got the following error:
I have also attached the error logs obtained when test_sample.py script was executed. Attached the used Test_Sample.py script as well. Selenium version used is `3.0.2
Please let me know what mistake i am doing ASAP.
PythonLogs.txt
test_sample_py.zip
The text was updated successfully, but these errors were encountered: