Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

browser.driver.get('/') does not prepend baseUrl before executing command #508

Closed
lavinjj opened this issue Feb 10, 2014 · 4 comments
Closed

Comments

@lavinjj
Copy link

lavinjj commented Feb 10, 2014

If you have a baseUrl set up in the configuration such as baseUrl = 'http://localhost:9090'; and you try to navigate to a page that does not have AngularJS running on it with browser.driver.get('/'); Selenium throws the following exception:

UnknownError: unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"}

However, if you navigate to the same page with browser.driver.get(browser.baseUrl + '/'); WebdriverJS is able to navigate tot he page properly without issue.

Shouldn't the baseUrl configuration option work in both cases?

@juliemr
Copy link
Member

juliemr commented Feb 10, 2014

Url resolution directly uses node's url.resolve, which works in kind of funny ways. See the docs: http://nodejs.org/api/url.html

@juliemr juliemr closed this as completed Feb 10, 2014
@demisx
Copy link

demisx commented Mar 23, 2014

Sorry, I still don't get it after reading multiple online posts. Is baseUrl in the config file supposed to work for e2e tests or not? I currently have this in the config:

 baseUrl: 'http://dev.hotili.net:8000'

but browser.baseUrl still resolves to original http://127.0.0.1:8000.

Thanks.

@juliemr
Copy link
Member

juliemr commented Mar 26, 2014

baseUrl in the config should work. Are you sure everything is up to date or you're not setting browser.baseUrl elsewhere?

@demisx
Copy link

demisx commented Mar 26, 2014

You are absolutely right! I was passing a --baseURL parameter in the gulp task that was overriding what I had set in the config file. I removed it and everything worked as expected.

Thank you for your support and the awesome product.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants