WinAppDriver fails to create new session on Surface. Got 404 error.

Created on 22 Jun 2016  路  10Comments  路  Source: microsoft/WinAppDriver

Hi,

I have installed WinAppDriver on a brand-new Surface.

If I run the driver with localhost and run a remote selenium client then /session fails on 404 error.
If I run the driver with ip address and run a remote selenium client then /session succeed.

Looks like driver checks IP Address from client request to what was passed to driver from command line. It is very strange behavior.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY>**<h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>**
</BODY></HTML>

session

Most helpful comment

The fact that it requires admin privileges to bind to non localhost suggests that driver might be using http.sys. It seems that it is possible to specify IP address as *. In that case driver will listen both on localhost and external ip address of you host machine. I've tried it locally and from the same machine I was able to get response both to http://localhost:5000/status and http://10.211.55.6:5000/status (IP option was set to *, port option was set to 5000).

All 10 comments

Any update?

Just to clarify - you have installed WinAppDriver on a Surface and you are targeting that machine from a Remote selenium client. Could you specify some cURL commands you are using from the remote client to target your WinAppDriver server so that we can try and repro the issue?

Test - Open app

DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"); rwd = new RemoteWebDriver(new URL("http://172.30.201.161:4723/wd"), capabilities);

Issue
If WinAppDriver runs without input parameters, it starts automatically with 127.0.0.1.
image
In the case, the test from remote machine FAILED.
In the case, the test from local (where WinAppDriver is running) machine SUCCESS.

If WinAppDriver gets IP Address as a input parameter.
image
In the case, the test from remote machine is SUCCESS.

Question
Why to provide IP Address? IMO, Server must get a PORT only.

I closed it by mistake. It is still relevant.

By default we don't want to bind to external-facing network interfaces for security reasons. It's by design that we're not remotely accessible.

Can you please consider to provide a new setting option?

The option allows to set security mode. By default, it will be secured (local). User can easy change it to unsecured (external) without providing external-facing IP Address.

In my case, external IP address may change after restart. I don't want to update batch file on each restart. The above option will avoid redundant maintenance of batch file.

Thanks in advance

Another strange case.
If WinAppDriver is configured with external IP address and you run a test from LOCAL machine (where WinAppDriver is running) then

Test with connect string that contains 172.30.201.161 will SUCCESS
new RemoteWebDriver(new URL("http://172.30.201.161:4723/wd"), capabilities);

Test with connect string that contains 127.0.0.1 will FAIL
new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd"), capabilities);

WDYT? Security :) ?

Thanks in advance

The fact that it requires admin privileges to bind to non localhost suggests that driver might be using http.sys. It seems that it is possible to specify IP address as *. In that case driver will listen both on localhost and external ip address of you host machine. I've tried it locally and from the same machine I was able to get response both to http://localhost:5000/status and http://10.211.55.6:5000/status (IP option was set to *, port option was set to 5000).

I will try. The /status URL works. Unfortunately, I can't check E2E scenario as WinAppDriver fail to run Application.
I opened new issue on that.
Thanks again

Thanks to NiackAb, the issue is closed.
Thanks again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SanjeevKumarmn picture SanjeevKumarmn  路  4Comments

jsa34 picture jsa34  路  3Comments

SimonKirkhamCL4U picture SimonKirkhamCL4U  路  3Comments

sky205 picture sky205  路  3Comments

RajneeshK2018 picture RajneeshK2018  路  4Comments