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

Method go_back

seleniumbase/fixtures/base_case.py:1356–1382  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1354 )
1355
1356 def go_back(self):
1357 self.__check_scope()
1358 if self.__is_cdp_swap_needed():
1359 self.cdp.go_back()
1360 return
1361 if getattr(self, "recorder_mode", None):
1362 self.save_recorded_actions()
1363 pre_action_url = None
1364 with suppress(Exception):
1365 pre_action_url = self.driver.current_url
1366 self.__last_page_load_url = None
1367 self.driver.back()
1368 with suppress(Exception):
1369 if pre_action_url == self.driver.current_url:
1370 self.driver.back() # Again because the page was redirected
1371 if self.recorder_mode:
1372 time_stamp = self.execute_script("return Date.now();")
1373 origin = self.get_origin()
1374 action = ["go_bk", "", origin, time_stamp]
1375 self.__extra_actions.append(action)
1376 if self.browser == "safari":
1377 self.wait_for_ready_state_complete()
1378 time.sleep(0.02)
1379 self.driver.refresh()
1380 time.sleep(0.02)
1381 self.wait_for_ready_state_complete()
1382 self.__demo_mode_pause_if_active()
1383
1384 def go_forward(self):
1385 self.__check_scope()

Callers

nothing calls this directly

Calls 10

__check_scopeMethod · 0.95
__is_cdp_swap_neededMethod · 0.95
save_recorded_actionsMethod · 0.95
execute_scriptMethod · 0.95
get_originMethod · 0.95
backMethod · 0.45
sleepMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected