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

Method open_html_file

seleniumbase/fixtures/base_case.py:3447–3462  ·  view source on GitHub ↗

Opens a local html file into the browser from a relative file path. The URL displayed in the web browser will start with "file://".

(self, html_file)

Source from the content-addressed store, hash-verified

3445 self.load_html_string(html_string, new_page)
3446
3447 def open_html_file(self, html_file):
3448 """Opens a local html file into the browser from a relative file path.
3449 The URL displayed in the web browser will start with "file://"."""
3450 self.__check_scope()
3451 if self.__looks_like_a_page_url(html_file):
3452 self.open(html_file)
3453 return
3454 if len(html_file) < 6 or not html_file.endswith(".html"):
3455 raise Exception('Expecting a ".html" file!')
3456 abs_path = os.path.abspath(".")
3457 file_path = None
3458 if abs_path in html_file:
3459 file_path = html_file
3460 else:
3461 file_path = os.path.join(abs_path, html_file)
3462 self.open("file://" + file_path)
3463
3464 def evaluate(self, expression):
3465 """Run a JavaScript expression and return the result."""

Callers 11

begin_presentationMethod · 0.95
display_chartMethod · 0.95
html_bestand_openenMethod · 0.80
ouvrir_html_fichierMethod · 0.80
apri_html_fileMethod · 0.80
abrir_archivo_htmlMethod · 0.80
HTML_파일_열기Method · 0.80
打开HTML文件Method · 0.80
abrir_arquivo_htmlMethod · 0.80

Calls 3

__check_scopeMethod · 0.95
openMethod · 0.95

Tested by

no test coverage detected