Skip to content

Commit

Permalink
Fix get_test_window in SeleniumExecutor to use the window_id arg
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Sep 7, 2018
1 parent 9506c25 commit 82f2a37
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tools/wptrunner/wptrunner/executors/executorselenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ def close_old_windows(self):

def get_test_window(self, window_id, parent):
test_window = None
if window_id:
try:
# Try this, it's in Level 1 but nothing supports it yet
win_s = self.webdriver.execute_script("return window['%s'];" % self.window_id)
win_obj = json.loads(win_s)
test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"]
except Exception:
pass
try:
# Try this, it's in Level 1 but nothing supports it yet
win_s = self.webdriver.execute_script("return window['%s'];" % window_id)
win_obj = json.loads(win_s)
test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"]
except Exception:
pass

if test_window is None:
after = self.webdriver.window_handles
Expand Down Expand Up @@ -296,7 +295,7 @@ def do_testharness(self, protocol, url, timeout):
parent_window = protocol.testharness.close_old_windows()
# Now start the test harness
protocol.base.execute_script(self.script % format_map)
test_window = protocol.testharness.get_test_window(webdriver, parent_window)
test_window = protocol.testharness.get_test_window(self.window_id, parent_window)

handler = CallbackHandler(self.logger, protocol, test_window)
while True:
Expand Down

0 comments on commit 82f2a37

Please sign in to comment.