The most basic way to get started with Selenium is to use it with the built-in Powershell on your Windows 10 or 11 assuming you’re on a Windows OS.
What is Selenium
To install Selenium, run the following command in your PowerShell prompt.
Install-Module -Name selenium -Scope CurrentUser ##or Install-Module -Name selenium -Scope CurrentUser -MinimumVersion 2.2.0 -AllowClobber -Force
Once Selenium has been installed, run this command to import the module
Import-Module -Name Selenium
To confirm that the module has been loaded, run this command
The results should show “Selenium” listed in the name column of the output.
I mainly use Chrome as my browser so, in the next step, I’ll show you how to get the webdriver installed. Open your Chrome browser and enter the following into your browser URL.
You should get something like this. My version is 108.0.5359.98.
Next, you’ll need to go to the following URL to download the Chrome Webdriver.
Make sure to download the package that corresponds to the version of Chrome you have. In my example, I would download Chrome (Web Driver) version 108 which will work with my browser.
Extract ChromeDriver.exe from the download file.
I use VSCode as my editor so for my case, I will go to the location in my C drive of Windows and then copy the extracted ChromeDriver.exe file and paste it into my Selenium assemblies folder to override the version there.
That’s it! Selenium and Chrome WebDriver is now installed. Stay tuned. In the next article, we’ll get to loading Selenium to do some cool stuff.
Get the latest from my blog when you sign up. Special offers are only offered to those who sign up. Specific DIY are emailed to users when they become available. Sign up today to get notified.