fortrace.utility.applications.web_browsers package

Submodules

fortrace.utility.applications.web_browsers.edge module

class fortrace.utility.applications.web_browsers.edge.Edge(qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericWebBrowser

Edge Web browser.

copilot(message: str) str[source]

Communicate with Edge’s Copilot.

Parameters:

message – message to sent to the Copilot

Returns:

answer send by the Copilot

save(destination: PathLike | None = None, name: str | None = None)[source]

Save the current page.

Parameters:
  • destination – path to save file to (defaults to downloads directory)

  • name – can be provided if the file should be renamed

fortrace.utility.applications.web_browsers.firefox module

class fortrace.utility.applications.web_browsers.firefox.Firefox(qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericWebBrowser

Firefox Web browser.

fortrace.utility.applications.web_browsers.web_browser module

class fortrace.utility.applications.web_browsers.web_browser.GenericWebBrowser(name: str, qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericApplication

Representation of a generic Web browser, providing basic functionality.

property active_tab
browse_to_url(url: str | Url, new_tab: bool = False)[source]

Browse to the provided URL or download file behind URL

If you provide the URL pointing directly to the file, most browsers will download it.

Parameters:
  • url – to destination url #TODO: check whether str is needed

  • new_tab – open it in a new tab. If yes, the focus will be on the new tab

close_tab()[source]

Close focused tab

focus_tab(url: str)[source]

Set focus on tab.

Parameters:
  • url – the url of the tab to be focused (the parameter is matched against all members of _active_tabs. The

  • selected) (first substring match is)

go_back()[source]

Go back one page.

go_forward()[source]

Go forward one page.

remove_from_favorite()[source]

Removes current page from bookmarks/favourites.

save(destination: PathLike | None = None, name: str | None = None)[source]

Save the current page.

Parameters:
  • destination – path to save file to (defaults to downloads directory)

  • name – can be provided if the file should be renamed

save_to_favorites()[source]

Bookmarks/’saves to favourites’ current page of active tab.

Start a web search from the address bar (as search engine can be specified there).

Parameters:
  • search_terms – the terms to search

  • search_engine – which search engine to use (None for browser default)

fortrace.utility.applications.web_browsers.web_browser_factory module

fortrace.utility.applications.web_browsers.web_browser_factory.get_web_browser(name: str, qs: QEMUMonitorSession, parent_notifier: ParentNotifier) GenericWebBrowser[source]

Factory to create a specific web browser application object.

Parameters:
  • name – name of the application (if not included ValueError is thrown)

  • qs – handle to QEMUMonitor

  • parent_notifier – attribute of desktop environment to handle changes in windows

Returns:

Application handle to opened web browser

Module contents