getCurrentUrl() protractor tests failing on Internet Explorer 11 (latest)
I added IE11 to /spec/multiConf.js and I could confirm an IE issue when testing AJAX-changed urls:
Failures:
1) protractor library should allow a mix of using protractor and using the driver directly
Message:
Expected 'http://localhost:8000/index.html' to equal 'http://localhost:8000/index.html#/form'.
Stacktrace:
Error: Failed expectation
at null.<anonymous> (/usr/local/lib/node_modules/protractor/spec/basic/lib_spec.js:36:11)
2) protractor library should allow a mix of using protractor and using the driver directly
Message:
Expected 'http://localhost:8000/index.html' to equal 'http://localhost:8000/index.html#/repeater'.
Stacktrace:
Error: Failed expectation
at null.<anonymous> (/usr/local/lib/node_modules/protractor/spec/basic/lib_spec.js:40:11)
Finished in 7.078 seconds
10 tests, 23 assertions, 2 failures
To recreate just run npm test agains IE11
The tests that fails is it('should allow a mix of using protractor and using the driver directly' at /spec/basic/lib_spec.js
I could also recreate on TravisCI - SauceLabs during a PR: https://travis-ci.org/angular/protractor/builds/24499725#L764
getCurrentUrl also fails for some of us in IE10 ( https://github.com/angular/protractor/issues/132 )
Thanks @KasMA1990 i think #132 should be reopened then this one be closed as duplicate.
Thanks for investigating - it's fine to track here and leave the old issue closed.
Here's an isolated SauceLabs test just looking at the changing URL. You can see from the screenshots that the URL in the browser looks correct, but it's not returning the path: https://saucelabs.com/jobs/36b8bad2d2144e009e9fc84052b8167a
Seems like an IEDriver bug. Let's make a simplified test case and report.
Right, I agree is an IEDriver bug.
I can also confirm by manually using webdriver JsonWireProtocol, e.g.
http://localhost:4444/wd/hub/sessions
http://localhost:4444/wd/hub/session/6fd6cb88-2d01-4ff5-80fe-ad2b78a0f548/url
Returns an outdated url on IE. Making the simplified test case + report might take time, for now i'm ok using getLocationAbsUrl()
If someone feels like putting some time on this, take a look at selenium source:
/java/client/test/org/openqa/selenium/MiscTest.java
And improve getCurrentUrl() testing cases:
@Test
public void testShouldReportTheCurrentUrlCorrectly() {
driver.get(pages.simpleTestPage);
assertTrue(pages.simpleTestPage.equalsIgnoreCase(driver.getCurrentUrl()));
driver.get(pages.javascriptPage);
assertTrue(pages.javascriptPage.equalsIgnoreCase(driver.getCurrentUrl()));
}
Are there any solutions or workarounds for this bug?
Workaround is using getLocationAbsUrl()
Ah yes, missed the () ;)
Awesome! You guys saved this guy a big headache with IE. Many thanks and I hope to offer something useful for you in the future.
getLocationAbsUrl() - Is supposed to work only on Angular pages ?
@sjelin can you confirm whether this is still an issue?
@cnishina windows
Closing this as not reproducible. Test steps to reproduce:
- Replace Firefox for Internet Explorer in spec/multiConf.js on the master branch.
- Internet explorer version 11.576.14393.0
- Using selenium standalone server 2.53.1, chromedriver 2.26 and IEDriver 32-bit version 2.53.1
- Ran test 10 times. Did not see this error.
Hi @cnishina @juliemr I am still facing this issue on following versions
- IE 10
- IE driver 64 bit ( 3.8.0 recommended version : http://www.seleniumhq.org/download/)
same issue on browser stack IE 10 as well, however It works fine on IE 11.
@abdulmoizeng
Protractor will never support / fix this because the browser is not supported by Microsoft since 2016. It's for all versions of IE (https://venturebeat.com/2016/01/12/microsoft-ends-support-for-ie8-ie9-ie10-and-windows-8/)