Installation of Selenium in VS Code Using Ubuntu Terminal 22.04
Step 1: Installing Google Chrome
(β’ Commands)
1.1 First of all, download the latest Gooogle Chrome Debian package on your system.
β’ wget -nc https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
1.2 Now, execute the following commands to install Google Chrome from the locally downloaded file.
β’ sudo apt update
β’ sudo apt install -f ./google-chrome-stable_current_amd64.deb
--> Press βyβ for all the confirmations asked by the installer.
Step 2: Installing Selenium and Webdriver for Python
We will use a virtual environment for running Python scripts. Follow the below steps to create
Python virtual environment and install the required python modules.
1.Create a directory to store Python scripts. Then switch to the newly-created directory.
β’ mkdir tests && cd tests
2. Set up the Python virtual environment and activate it
β’ python3 -m venv venv
β’ source venv/bin/activate
3. Now use PIP to install the selenium and webdriver-manager Python modules under the virtual environment.
β’ install selenium webdriver-manager
4. Change directory and create a file
β’ cd
β’ code . (VS code opens create a file with name) (Space is must between code and .)
β’ cd tests (Tests is sample file name enter your file name that is created in vs code)
β’ code . (after it get into the tests folder)
5. After the installation opening and running the vs code and running the program should be done in ubuntu 22.04
5.1 Code . : Is to open vs code
5.2 Python filename.py : is used to run the program