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

Function do_playback

seleniumbase/console_scripts/sb_recorder.py:190–242  ·  view source on GitHub ↗
(file_name, brx, window, demo_mode=False)

Source from the content-addressed store, hash-verified

188
189
190def do_playback(file_name, brx, window, demo_mode=False):
191 file_name = file_name.strip()
192 error_msg = file_name_error(file_name)
193 if error_msg:
194 messagebox.showwarning(
195 "Invalid filename", "Invalid filename: %s" % error_msg
196 )
197 return
198 if not os.path.exists(os.getcwd() + "/" + file_name):
199 messagebox.showwarning(
200 "File does not exist",
201 'File "%s" does not exist in the current directory!' % file_name,
202 )
203 return
204 # command = "%s -m pytest %s -q -s" % (sys_executable, file_name)
205 command = "%s %s -q -s" % (sys_executable, file_name)
206 if shared_utils.is_linux():
207 command += " --gui"
208 if "edge" in brx.lower():
209 command += " --edge"
210 elif "opera" in brx.lower():
211 command += " --opera"
212 elif "brave" in brx.lower():
213 command += " --brave"
214 elif "comet" in brx.lower():
215 command += " --comet"
216 elif "atlas" in brx.lower():
217 command += " --atlas"
218 elif "chromium" in brx.lower():
219 command += " --use-chromium"
220 if demo_mode:
221 command += " --demo"
222 command_args = sys.argv[2:]
223 if (
224 "--uc" in command_args
225 or "--cdp" in command_args
226 or "--undetected" in command_args
227 or "--undetectable" in command_args
228 ):
229 command += " --uc"
230 poll = None
231 if sb_config.rec_subprocess_used:
232 poll = sb_config.rec_subprocess_p.poll()
233 if not sb_config.rec_subprocess_used or poll is not None:
234 print(command)
235 subprocess.Popen(command, shell=True)
236 else:
237 messagebox.showwarning(
238 "SeleniumBase Recorder: Already Running!",
239 "Please finalize the active recording from the terminal\n"
240 'where you opened the Recorder: Type "c" and hit Enter.',
241 )
242 send_window_to_front(window)
243
244
245def create_tkinter_gui():

Callers 1

create_tkinter_guiFunction · 0.85

Calls 2

file_name_errorFunction · 0.85
send_window_to_frontFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…