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

Function highlight_element_with_js_2

seleniumbase/fixtures/js_utils.py:1106–1162  ·  view source on GitHub ↗
(driver, message, element, o_bs, msg_dur)

Source from the content-addressed store, hash-verified

1104
1105
1106def highlight_element_with_js_2(driver, message, element, o_bs, msg_dur):
1107 with suppress(Exception):
1108 # This closes any pop-up alerts
1109 execute_script(driver, "")
1110 script = (
1111 """arguments[0].style.boxShadow =
1112 '0px 0px 6px 6px rgba(128, 128, 128, 0.5)';"""
1113 )
1114 try:
1115 execute_script(driver, script, element)
1116 except Exception:
1117 return
1118 time.sleep(0.0181)
1119 script = (
1120 """arguments[0].style.boxShadow =
1121 '0px 0px 6px 6px rgba(205, 30, 0, 1)';"""
1122 )
1123 try:
1124 execute_script(driver, script, element)
1125 except Exception:
1126 return
1127 time.sleep(0.0181)
1128 script = (
1129 """arguments[0].style.boxShadow =
1130 '0px 0px 6px 6px rgba(128, 0, 128, 1)';"""
1131 )
1132 try:
1133 execute_script(driver, script, element)
1134 except Exception:
1135 return
1136 time.sleep(0.0181)
1137 script = (
1138 """arguments[0].style.boxShadow =
1139 '0px 0px 6px 6px rgba(50, 50, 128, 1)';"""
1140 )
1141 try:
1142 execute_script(driver, script, element)
1143 except Exception:
1144 return
1145 time.sleep(0.0181)
1146 script = (
1147 """arguments[0].style.boxShadow =
1148 '0px 0px 6px 6px rgba(50, 205, 50, 1)';"""
1149 )
1150 try:
1151 execute_script(driver, script, element)
1152 except Exception:
1153 return
1154 time.sleep(0.0181)
1155 with suppress(Exception):
1156 activate_jquery(driver)
1157 post_messenger_success_message(driver, message, msg_dur)
1158 script = """arguments[0].style.boxShadow = '%s';""" % (o_bs)
1159 try:
1160 execute_script(driver, script, element)
1161 except Exception:
1162 return
1163

Callers

nothing calls this directly

Calls 4

execute_scriptFunction · 0.85
activate_jqueryFunction · 0.85
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…