Skip to content

Instantly share code, notes, and snippets.

@titusfortner
Last active December 25, 2023 17:20
Show Gist options
  • Save titusfortner/aec103e9b02709f771497fdb8b21154c to your computer and use it in GitHub Desktop.
Save titusfortner/aec103e9b02709f771497fdb8b21154c to your computer and use it in GitHub Desktop.
Current Instructions for Selenium Dev Environment on Windows

Update

The most recent instructions are now on the Selenium readme: https://github.com/SeleniumHQ/selenium/blob/trunk/README.md#installing

Outdated instructions

  • Windows Settings - turn on "Developer mode."
  • Run PowerShell As Administrator
  • Change execution policy: Set-ExecutionPolicy Unrestricted
  • Install chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  • Install git: choco install git
  • Install Java: choco install openjdk11
  • Install Bazelisk: choco install bazelisk
  • Install Msys2: choco install msys2 --params "/InstallDir=C:\tools\msys64"
  • Install Visual Studio:
  • Add System Environment Variables:
    • Add to PATH value "C:\tools\msys64\usr\bin"`
    • Set BAZEL_SH to "C:\tools\msys64\usr\bin\bash.exe"
    • Set BAZEL_VC to "C:\Program Files\Microsoft Visual Studio\2022\Community\VC" (this might be in x86 folder instead)
    • Set BAZEL_VC_FULL_VERSION to version of command line tools; find the directory name inside $BAZEL_VC/Tools/MSVC directory; Make sure to use this and not the version Visual Studio says it installed
  • Restart Computer
  • Open Developer Command Prompt for Visual Studio 2022
  • Create a projects directory & run git clone https://github.com/SeleniumHQ/selenium
  • Change directory: cd selenium
  • Test Build: bazel build //dotnet/test/common:chrome
  • Run Tests:
    • cd dotnet
    • dotnet test test/common/WebDriver.Common.Tests.csproj --framework net6.0
    • set ACTIVE_DRIVER_CONFIG=Firefox
    • dotnet test test/common/WebDriver.Common.Tests.csproj --framework net6.0
@titusfortner
Copy link
Author

I've updated the official selenium readme with the latest instructions,
Please follow that one instead

https://github.com/SeleniumHQ/selenium/blob/trunk/README.md#installing
I even created a powershell script you can use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment