To add support for a new version of the Chromium DevTools Protocol to the .NET bindings,
perform the following steps, where <N>
is the major version of the protocol:
- Add the new version string (
v<N>
) to theSUPPORTED_DEVTOOLS_VERSIONS
list in//dotnet:selenium-dotnet-version.bzl
. - Create a new directory at
//dotnet/src/webdriver/DevTools/v<N>
, and copy the contents of the//dotnet/src/webdriver/DevTools/v<N-1>
directory into it. - Rename each of the
*.cs
files in//dotnet/src/webdriver/DevTools/v<N>
so that the file names start withV<N>
instead ofV<N-1>
. - In each of the
*.cs
files in//dotnet/src/webdriver/DevTools/v<N>
, update all occurrences ofV<N-1>
toV<N>
. IMPORTANT: Do not change the case ofV<N>
in each.cs
file. - In
//dotnet/src/webdriver/DevTools/DevToolsDomains.cs
, add an entry for version<N>
to theSupportedDevToolsVersions
dictionary initialization. - In
//dotnet/src/webdriver:WebDriver.csproj.prebuild.cmd
, add the following block (substituting the proper value for<N>
):
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v<N>\DevToolsSessionDomains.cs" (
echo Generating CDP code for version <N>
pushd "%1..\..\.."
bazel build //dotnet/src/webdriver/cdp:generate-v<N>
popd
)
- In
//dotnet/src/webdriver:WebDriver.csproj.prebuild.sh
, add the following block (substituting the proper value for<N>
):
if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v<N>/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version <N>"
bazel build //dotnet/src/webdriver/cdp:generate-v<N>
fi
- In each of the
*.cs
files in//dotnet/test/common/DevTools/
, update all occurrences ofV<N-2>
toV<N-1>
. For now, due to issues with timeliness of CI tool updates, we keep this one version behind the latest. - Commit the changes.
To remove support for a version of the Chromium DevTools Protocol from the .NET bindings,
perform the following steps, where <N>
is the major version of the protocol:
- Delete the contents of the
//dotnet/src/webdriver/DevTools/v<N>
directory. - In
//dotnet/src/webdriver/DevTools/DevToolsDomains.cs
, remove the entry for version<N>
from theSupportedDevToolsVersions
dictionary initialization. - Remove the version string (
v<N>
) from theSUPPORTED_DEVTOOLS_VERSIONS
list in//dotnet:selenium-dotnet-version.bzl
. - Commit the changes.