The most recent instructions are now on the Selenium readme: https://github.com/SeleniumHQ/selenium/blob/trunk/README.md#installing
- 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:
- Download Visual Studio Professional 17.5.1 from https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history
- Open Installer, cancel the modal and click the “Available” Tab
- Select to install Visual Studio Community
- Select .NET Desktop Development
- Add optional development tools for 4.6.2-4.7.1 and 4.8.1
- Select C++ Desktop Development
- 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
- Add to
- 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
The instruction about setting
BAZEL_VC_FULL_VERSION
is a bit unclear. I had misunderstood this instruction, thinking that I was supposed to set this variable to the path to the folder under$BAZEL_VC/Tools/MSVC
. This variable actually needs to be set to the name of this folder. For example: