withNewWindow not working in IE

243 views
Skip to first unread message

Alexander Kriegisch

unread,
May 13, 2016, 4:53:56 AM5/13/16
to Geb User Mailing List
Hello.

Are there any know problems with 'withNewWindow' in IE (testing on Edge with Geb 0.12.2 and IE Selenium driver 2.52.2)? I have a case her in which a button click opens a new window and displays the right page, but Geb does not recognise the new window. If I wrap the 'withNewWindow' call into 'waitFor' with additional log output, I see that Geb tries to click the button again and again even though the window has long been open. The same Test works in other browsers, among them Chrome, PhantomJS, Safari.

Thanks

Marcin Erdmann

unread,
May 15, 2016, 6:57:35 AM5/15/16
to Geb User Mailing List
Hi Alexander,

No, there are no known issues with 'withNewWindow' in Edge, but to be honest the test harness is currently not run on Edge at all (https://github.com/geb/issues/issues/424). If you could produce a self contained example showing the issue then it would be grand and a massive help to track down the issue. I will also try to find some time in the coming days to work on implementing #424 to see if we can reproduce that way.

Marcin

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/7285e0a6-bcf2-42c4-bdf7-7451a11d2683%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcin Erdmann

unread,
May 15, 2016, 8:03:42 AM5/15/16
to Geb User Mailing List
Ok, so I did try running the basic window handling tests (https://github.com/geb/geb/blob/b23f2d808f895897fa90ba02eb83b6fde50a96d0/module/geb-core/src/test/groovy/geb/window/BasicWindowHandlingSpec.groovy) against Edge 13 (25.10586.0.0) in BrowserStack and here are my findings:

- switching to window by name does not work for Edge (the driver reports no such window) but works for other browsers and should work according to the javadoc for WebDriver.TargetLocator.window() - http://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebDriver.TargetLocator.html#window-java.lang.String-
- calling WebDriver.close() closes the window but never returns - http://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebDriver.html#close--

You could in theory try to work around these issues by using WebDriver directly and avoiding using these capabilities but Geb's window handling helpers depend heavily on the above two capabilities thus making them unusable.

Also, it looks like WebDriver support for Edge is still experimental: https://developer.microsoft.com/en-us/microsoft-edge/platform/status/webdriver/details/. You might want to let them know about the two issues I found as window handling commands are marked as "Preview" on that list.

Alexander Kriegisch

unread,
May 17, 2016, 2:39:24 AM5/17/16
to Geb User Mailing List
Sorry, stupid question: I have the problem in IE 11 and was under the impression that this is equal to Edge. But now I am not so sure anymore because the About dialog still says "Internet Explorer".

Marcin Erdmann

unread,
May 17, 2016, 8:04:01 AM5/17/16
to Geb User Mailing List
IE11 is IE11 and Edge is the successor of IE11. Are you saying that you misreported the issue to occur with Edge instead of IE11?

As far as I'm aware there are no issues with working with multiple windows when using IE11 and we have test coverage for that. If you still believe that you found something then I will need a self contained sample showing the issue.

Alexander Kriegisch

unread,
May 17, 2016, 8:21:51 AM5/17/16
to Geb User Mailing List
Yes, this is what I am saying. I misreported. Mea maxima culpa. Our issues are really in IE11.

Alexander Kriegisch

unread,
May 20, 2016, 4:16:35 AM5/20/16
to Geb User Mailing List
Here is my update on the issue: The problem seems to be an enterprise group policy not permitting me to configure IE settings as necessary for Geb/Selenium testing. It works when I run the same test in a cloud environment (TestChameleon) for this very simple case:

package de.scrum_master.geb

import geb.spock.GebReportingSpec
import spock.lang.Unroll

class MyGebTest extends GebReportingSpec {
def testNestedNewTabs() {
when:
go "http://scrum-master.de/"
report "Scrum-Master"

then:
title.contains "Scrum-Master.de"

and:
println "Open windows: ${availableWindows.size()} -> ${availableWindows}"
withNewWindow({ $("a", text: contains("Abschied von der Hierarchie")).click() }) {
title.contains "Abschied von der Hierarchie"
report "Computerwoche"
println "Open windows: ${availableWindows.size()} -> ${availableWindows}"

withNewWindow({ $("a", title: contains("Druckansicht")).firstElement().click() }) {
title.contains "Druckansicht"
report "Druckansicht"
println "Open windows: ${availableWindows.size()} -> ${availableWindows}"
true
}
println "Open windows: ${availableWindows.size()} -> ${availableWindows}"


true
}
println "Open windows: ${availableWindows.size()} -> ${availableWindows}"
}
}


It prints something like this:

Open windows: 1 -> [3d00470d-518d-483a-93a0-ec874b155ed3]
Open windows: 2 -> [3d00470d-518d-483a-93a0-ec874b155ed3, 5c8095ab-b1ac-4894-9650-77bf0e4fece9]
Open windows: 3 -> [3d00470d-518d-483a-93a0-ec874b155ed3, 5c8095ab-b1ac-4894-9650-77bf0e4fece9, 67c370e4-22dc-4027-bdc9-3ab4c44833b6]
Open windows: 2 -> [3d00470d-518d-483a-93a0-ec874b155ed3, 5c8095ab-b1ac-4894-9650-77bf0e4fece9]
Open windows: 1 -> [3d00470d-518d-483a-93a0-ec874b155ed3]

In a more complex scenario which I cannot easily reproduce here because it relies on our internal code base, it still fails in the cloud test for IE, but works in other browsers like PhantomJS or Chrome.
Reply all
Reply to author
Forward
0 new messages