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
I'm not able to create symlink when execute the command "bazel build //dotnet/test/common:chrome". The file apple_rules_lint with version 0.3.2.tar.gz is actually downloaded to C:\Users<user>_bazel_Hobin\3h4r744v\external\apple_rules_lint\temp4940371202000673584.
C:\Users<user>\Documents\selenium>bazel build //dotnet/test/common:chrome
INFO: Repository apple_rules_lint instantiated at:
C:/users//documents/selenium/WORKSPACE:7:13: in
Repository rule http_archive defined at:
C:/users//_bazel_hobin/ep2vbwzd/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in
INFO: repository @apple_rules_lint' used the following cache hits instead of downloading the corresponding file.
If the definition of 'repository @apple_rules_lint' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'apple_rules_lint':
Traceback (most recent call last):
File "C:/users//_bazel_hobin/ep2vbwzd/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284/0.3.2.tar.gz to C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284: Cannot create symlink (name=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, target=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, \?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): createSymbolicLinkW failed
ERROR: C:/users//documents/selenium/WORKSPACE:7:13: fetching http_archive rule //external:apple_rules_lint: Traceback (most recent call last):
File "C:/users//_bazel_hobin/ep2vbwzd/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284/0.3.2.tar.gz to C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284: Cannot create symlink (name=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, target=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, \?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): createSymbolicLinkW failed
ERROR: Error computing the main repository mapping: no such package '@apple_rules_lint//lint': java.io.IOException: Error extracting C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284/0.3.2.tar.gz to C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint/temp12861043901534462284: Cannot create symlink (name=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, target=C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint\example.bazelversion, \?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\?\C:\users<user>_bazel_hobin\ep2vbwzd\external\apple_rules_lint.bazelversion): createSymbolicLinkW failed
Loading:
Fetching C:/users//_bazel_hobin/ep2vbwzd/external/apple_rules_lint; Extracting 0.3.2.tar.gz