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?
Url resolution directly uses node's url.resolve, which works in kind of funny ways. See the docs: http://nodejs.org/api/url.html
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.
baseUrl in the config should work. Are you sure everything is up to date or you're not setting browser.baseUrl elsewhere?
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.
Most helpful comment
Sorry, I still don't get it after reading multiple online posts. Is
baseUrlin the config file supposed to work for e2e tests or not? I currently have this in the config:but
browser.baseUrlstill resolves to originalhttp://127.0.0.1:8000.Thanks.