Skip to content

Improve WebDriver Management When Running from Executable #3615

@izharus

Description

@izharus

Improve WebDriver Management When Running from Executable

Issue Description

When SeleniumBase scripts are packaged into an executable file (using PyInstaller or similar tools), webdrivers are downloaded and stored in a temporary directory that is created and deleted on each execution of the executable file. This is inefficient and causes unnecessary downloads, on Windows systems.

Current Behavior

  • When running from an executable (.exe), SeleniumBase downloads webdrivers to a temporary directory on each execution
  • This temporary directory is typically removed after the program terminates
  • The next execution requires downloading the drivers again

Proposed Solution

Modify SeleniumBase to detect if it's running from an executable file and adjust the DRIVER_DIR accordingly:

  1. If running from a Python script (.py file): Keep the current behavior
  2. If running from an executable (has sys.frozen attribute): Save drivers in a persistent "drivers" folder alongside the executable file

I can create a PR if your are insterested in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThe answer/solution already exists somewhereexternalOutside SeleniumBase's scope. / Ask somewhere else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions