Skip to content

Commit 829e346

Browse files
cwd-googV8 LUCI CQ
authored andcommitted
loading switch_tab start search after current
Change the code so that we start the search for a matching tab after the current tab instead of on the current tab. This allows us to cycle between tabs that have the same URL. Change-Id: I83376ff419db4265989548be90862b7e8bee9e58 Reviewed-on: https://chromium-review.googlesource.com/c/crossbench/+/6656089 Reviewed-by: Kameron Lutes <[email protected]> Commit-Queue: Charles Dick <[email protected]>
1 parent 326810a commit 829e346

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crossbench/browsers/chromium_based/webdriver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def switch_tab(
250250
if tab_index is not None:
251251
handles = [driver.window_handles[tab_index]]
252252
else:
253-
handles = driver.window_handles[i:] + driver.window_handles[:i]
253+
# Start searching with the tab after the current tab.
254+
handles = driver.window_handles[i + 1:] + driver.window_handles[:i + 1]
254255

255256
for handle in handles:
256257
driver.switch_to.window(handle)

0 commit comments

Comments
 (0)