Skip to content
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

Wrong URL Path causes Proxy error. #2437

Closed
marcioarend opened this issue Jul 7, 2016 · 3 comments
Closed

Wrong URL Path causes Proxy error. #2437

marcioarend opened this issue Jul 7, 2016 · 3 comments
Labels

Comments

@marcioarend
Copy link

Meta - Wrong URL Path causes Proxy error.

OS:

Selenium Version:

Browser:

Browser Version:

Expected Behavior -

I am using selenium with Browserstack with Node to test my angular programm.
I am working in a Company and we are behind a Proxy.
I tested the conection from my computer with Browserstack with Nightwatch and it worked perfect.

But when I tried to use Selenium I faced a Proxy error. I am trying to solve this problem for almost 3 days until today, when I found the problem.

Actual Behavior -

The problem was in the URL path:
in the Node.js BrowserStack example we have this URL
usingServer('http://hub-cloud.browserstack.com/wd/hub').
but my proxy shown only
/wd/hub/session

I think I found the problem by
http/index.js (line 273)
var path = this.options_.path; if (path[path.length - 1] === '/' && httpRequest.path[0] === '/') { path += httpRequest.path.substring(1); } else { path += httpRequest.path; // hier we have only the path, without host }

I have done this
path = "http://" + this.options_.host + path;

and its worked

Steps to reproduce -

Use the example from BrowserStack
https://www.browserstack.com/automate/node

Set the proxy
usingWebDriverProxy("your Proxy 8080").

Error

Der folgende Fehler wurde beim Versuch die URL /wd/hub/session zu holen festgestellt:

@jleyba jleyba added the C-nodejs label Jul 8, 2016
@jleyba
Copy link
Contributor

jleyba commented Jul 8, 2016

Duplicate of #2309

@jleyba jleyba closed this as completed Jul 8, 2016
@marcioarend
Copy link
Author

marcioarend commented Jul 8, 2016

I have the version [email protected] and I still facing the problem. But when I use My workaround it works,
I think the problem deserve further investigation

As I said, if I change the code to this, its worked

var path = this.options_.path;
if (path[path.length - 1] === '/' && httpRequest.path[0] === '/') {
path += httpRequest.path.substring(1);
} else {
path += httpRequest.path;
path = "http://" + this.options_.host + path;
//console.log("index.js line 266 path ------> " + path);
}

otherwise I recive this error
Der folgende Fehler wurde beim Versuch die URL /wd/hub/session zu holen festgestellt:


Console log Without workaround

index.js line 266 path ------> /wd/hub/session

Console log With workaround
[14:11:11] I/hosted - Using the selenium server at http://hub-cloud.browserstack.com/wd/hub
[14:11:11] I/launcher - Running 1 instances of WebDriver
index.js line 266 path ------> http://hub-cloud.browserstack.com/wd/hub/session
index.js line 266 path ------> http://hub-cloud.browserstack.com/wd/hub/session/e99b678196e11b6071af429087fdacc1ce7bbb76/timeouts/async_script
Started
index.js line 266 path ------> http://hub-cloud.browserstack.com/wd/hub/session/e99b678196e11b6071af429087fdacc1ce7bbb76/url
index.js line 266 path ------> http://hub-cloud.browserstack.com/wd/hub/session/e99b678196e11b6071af429087fdacc1ce7bbb76/screenshot
1 spec, 0 failures
Finished in 5.605 seconds
index.js line 266 path ------> http://hub-cloud.browserstack.com/wd/hub/session/e99b678196e11b6071af429087fdacc1ce7bbb76
[14:11:32] I/launcher - 0 instance(s) of WebDriver still running
[14:11:32] I/launcher - Chrome #1 passed

@jleyba
Copy link
Contributor

jleyba commented Jul 8, 2016

The fix is not in 2.53.3. It will be in the next release
On Fri, Jul 8, 2016 at 5:08 AM marcioarend [email protected] wrote:

I have the version [email protected] and I still facing the
problem. But when I use My workaround it works,
I think the problem deserve further investigation

As I said, if I change the code to this, its working

var path = this.options_.path;
if (path[path.length - 1] === '/' && httpRequest.path[0] === '/') {
path += httpRequest.path.substring(1);
} else {
path += httpRequest.path;

path = "http://" + this.options_.host + path;

//console.log("index.js line 266 path ------> " + path);
}

otherwise I recive this error

Der folgende Fehler wurde beim Versuch die URL /wd/hub/session zu holen
festgestellt:


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
#2437 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAPkCb5ONdcICwTAfzuO29wdcMO79Il4ks5qTj2lgaJpZM4JHLBx
.

@lock lock bot locked and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants