Skip to content

Commit 2f80b1d

Browse files
committed
Fixing test to switch back to the original window after opening a new one.
1 parent c0af850 commit 2f80b1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

java/client/test/org/openqa/selenium/WindowSwitchingTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
public class WindowSwitchingTest extends JUnit4TestBase {
5151

52-
//@Ignore({MARIONETTE})
52+
@Ignore({MARIONETTE})
5353
@NoDriverAfterTest // So that next test never starts with "inside a frame" base state.
5454
@Test
5555
public void testShouldSwitchFocusToANewWindowWhenItIsOpenedAndNotStopFutureOperations() {
@@ -179,11 +179,13 @@ public void testShouldThrowNoSuchWindowExceptionOnAnyElementOperationIfAWindowIs
179179

180180
@NeedsFreshDriver
181181
@NoDriverAfterTest
182-
@Ignore({IE, MARIONETTE, REMOTE})
182+
@Ignore({IE, REMOTE})
183183
@Test
184184
public void testShouldBeAbleToIterateOverAllOpenWindows() {
185185
driver.get(pages.xhtmlTestPage);
186+
String original = driver.getWindowHandle();
186187
driver.findElement(By.name("windowOne")).click();
188+
driver.switchTo().window(original);
187189
driver.findElement(By.name("windowTwo")).click();
188190

189191
wait.until(windowHandleCountToBeGreaterThan(2));

0 commit comments

Comments
 (0)