MCPcopy Index your code
hub / github.com/seleniumbase/SeleniumBase / safe_execute_script

Method safe_execute_script

seleniumbase/fixtures/base_case.py:3523–3531  ·  view source on GitHub ↗

When executing a script that contains a jQuery command, it's important that the jQuery library has been loaded first. This method will load jQuery if it wasn't already loaded.

(self, script, *args, **kwargs)

Source from the content-addressed store, hash-verified

3521 return js_utils.execute_async_script(self.driver, script, timeout)
3522
3523 def safe_execute_script(self, script, *args, **kwargs):
3524 """When executing a script that contains a jQuery command,
3525 it's important that the jQuery library has been loaded first.
3526 This method will load jQuery if it wasn't already loaded."""
3527 self.__check_scope()
3528 self._check_browser()
3529 if not js_utils.is_jquery_activated(self.driver):
3530 self.activate_jquery()
3531 return self.driver.execute_script(script, *args, **kwargs)
3532
3533 def get_element_at_x_y(self, x, y):
3534 """Return element at current window's x,y coordinates."""

Callers 15

drag_and_dropMethod · 0.95
js_clickMethod · 0.95
jquery_clickMethod · 0.95
jquery_click_allMethod · 0.95
hide_elementMethod · 0.95
hide_elementsMethod · 0.95
show_elementMethod · 0.95
show_elementsMethod · 0.95
remove_elementMethod · 0.95
remove_elementsMethod · 0.95
jquery_update_textMethod · 0.95
__jquery_clickMethod · 0.95

Calls 4

__check_scopeMethod · 0.95
_check_browserMethod · 0.95
activate_jqueryMethod · 0.95
execute_scriptMethod · 0.45

Tested by

no test coverage detected