Skip to content

Conrec-Infinity-AB/Selenium-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

131 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test automation with Selenium

This is the main repository for the course Test automation with Selenium created by Conrec Infinity where we will learn how to use Selenium and Python to test web pages.

Installation instructions will be targeted for the Windows platform but using Mac OSX or Linux will also work. Some instructions will need some tweaking. The examples and lectures will focus on Python but can be applied to other languages like C# and Java too.

Python and tools setup for Windows

Python 3

Download the Python executable from http://python.org and run setup.

Select Install Now to install and use default installation path and options or select Customize installation if you want to customize the settings. Select the option Add python.exe to PATH so we can use Python from any folder location later on.

Verify Python setup by opening a Command prompt or Powershell terminal and write the following commands:

python --version

Result: Python 3.x.y

pip --version

Result: pip 2x.y.z

GIT

Download GIT (64-bit version) from https://www.git-scm.com and run setup. There is a lot of options but I recommend to use default options for now.

Verify GIT setup by opening a command prompt or Powershell terminal and write the following commands:

git --version

Result: git version 2.x.y

Optional - Setup your name and e-mail to use when pushing code to a repository:

git config --global user.name "Your name"

git config --global user.email your@email.xyz

Visual Studio Code

Download the VSCode executable from https://code.visualstudio.com and run setup.

Default options is enough but if you want to start VS Code from any folder location then select the option Add to PATH (requires shell restart).

Start Visual Studio Code and click on the extensions to the left of VS Code window and search for Python and install the Python extension from Microsoft - IntelliSense (Pylance) ...

Also install the Live Server extension which will be used to test local web pages.

Clone and open repository

Open a command prompt or Powershell terminal and create a folder where you want the Selenium project to reside:

mkdir ConrecInfinity

cd ConrecInfinity

Run the following command to download this repository:

git clone https://github.com/Conrec-Infinity-AB/Selenium-Course.git

A warning will appear, just answer Yes to the question.

The authenticity of host 'github.com (140.82.121.3)' can't be established.

Are you sure you want to continue connecting (yes/no/[fingerprint])?

In VS Code select Open folder and select the folder Selenium-Course where the repository was cloned to.

If a warning is visible about trust of the files and folder is visible then select Yes, I trust the authors.

Setup a local Python virtual environment and download Selenium related packages

When we work with different Python projects it's always a good practise to create a virtual environment for the project we are working with so we don't install Python packages globally.

After we have openend our Selenium-Course project In visual Studio Code, open the Command Palette by using CTRL + SHIFT + P or selecting it in the View Menu

Search for Python: Create Environment.. and select it.

In the dropdown select the option Venv

Select the Python 3.x.y Python interpreter.

Select the requirements.txt file and OK

The virtual environment will be created and the Python packages used in this course will be downloaded.

Test setup

Open the file ./Lecture1/code/1_openingPage.py and run it by selecting Run / Run without debugging in the menu. If everything is setup correct then a Chrome web browser should open and close.

The text below should be visible in Viual Studio Code terminal:

Title is: Home Page

Links

About

This is the main repository for the course Test automation with Selenium created by Conrec Infinity where we will learn how to use Selenium and Python to test web pages

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors