MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / __set_window_rect

Method __set_window_rect

seleniumbase/core/sb_cdp.py:1262–1287  ·  view source on GitHub ↗
(self, x, y, width, height, uc_lock=False)

Source from the content-addressed store, hash-verified

1260 return self.loop.run_until_complete(self.page.medimize())
1261
1262 def __set_window_rect(self, x, y, width, height, uc_lock=False):
1263 if uc_lock:
1264 gui_lock = FileLock(constants.MultiBrowser.PYAUTOGUILOCK)
1265 with gui_lock:
1266 self.__make_sure_pyautogui_lock_is_writable()
1267 if self.get_window()[1].window_state.value == "minimized":
1268 self.loop.run_until_complete(
1269 self.page.set_window_size(
1270 left=x, top=y, width=width, height=height)
1271 )
1272 time.sleep(0.044)
1273 return self.loop.run_until_complete(
1274 self.page.set_window_size(
1275 left=x, top=y, width=width, height=height)
1276 )
1277 else:
1278 if self.get_window()[1].window_state.value == "minimized":
1279 self.loop.run_until_complete(
1280 self.page.set_window_size(
1281 left=x, top=y, width=width, height=height)
1282 )
1283 time.sleep(0.044)
1284 return self.loop.run_until_complete(
1285 self.page.set_window_size(
1286 left=x, top=y, width=width, height=height)
1287 )
1288
1289 def set_window_rect(self, x, y, width, height):
1290 return self.__set_window_rect(x, y, width, height, uc_lock=True)

Callers 6

maximizeMethod · 0.95
set_window_rectMethod · 0.95
reset_window_sizeMethod · 0.95
gui_click_x_yMethod · 0.95
gui_drag_drop_pointsMethod · 0.95
gui_hover_x_yMethod · 0.95

Calls 4

get_windowMethod · 0.95
set_window_sizeMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected