protractor icon indicating copy to clipboard operation
protractor copied to clipboard

getCurrentUrl() protractor tests failing on Internet Explorer 11 (latest)

Open elgalu opened this issue 12 years ago • 16 comments

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

elgalu avatar May 06 '14 01:05 elgalu

getCurrentUrl also fails for some of us in IE10 ( https://github.com/angular/protractor/issues/132 )

KasMA1990 avatar May 06 '14 07:05 KasMA1990

Thanks @KasMA1990 i think #132 should be reopened then this one be closed as duplicate.

elgalu avatar May 06 '14 15:05 elgalu

Thanks for investigating - it's fine to track here and leave the old issue closed.

juliemr avatar May 16 '14 21:05 juliemr

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.

juliemr avatar May 22 '14 20:05 juliemr

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()

elgalu avatar May 29 '14 22:05 elgalu

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()));
}

elgalu avatar May 30 '14 20:05 elgalu

Are there any solutions or workarounds for this bug?

MrJH avatar Jul 08 '14 13:07 MrJH

Workaround is using getLocationAbsUrl()

elgalu avatar Jul 08 '14 14:07 elgalu

Ah yes, missed the () ;)

MrJH avatar Jul 08 '14 15:07 MrJH

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.

robertbarfield avatar Oct 21 '14 14:10 robertbarfield

getLocationAbsUrl() - Is supposed to work only on Angular pages ?

smahalingam avatar Nov 17 '14 16:11 smahalingam

@sjelin can you confirm whether this is still an issue?

juliemr avatar Jul 13 '16 20:07 juliemr

@cnishina windows

sjelin avatar Dec 21 '16 13:12 sjelin

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.

cnishina avatar Dec 23 '16 00:12 cnishina

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 avatar Jan 11 '18 19:01 abdulmoizeng

@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/)

wswebcreation avatar Jan 13 '18 06:01 wswebcreation