Task-18 Submission
Published: 2024-01-23 20:21:49

describe the Python Selenium architecture in details?

The architecture of Selenium is composed of 
1. Selenium IDE
2. Selenium Remote Control
3. Selenium WebDriver
4. Selenium Grid

Selenium IDE: it is call as Integrated development Environment, it can do code faster, it can be debugged and it can be also used
for auto completion purpose. Selenium IDE is basically web browser an extension that you need to download and install the extension for that
particular web browser and start working with it. we could do what is the task to do, what is the target need to do, what is the 
value you need to do, it can automate and it can be record. People generally do not use it rather they use the selenium script for the same


Selenium Remote Control: it is an outdated technology, it is replaced by WebDriver which is very easy to use it and we don't using it these days

Selenium WebDriver: it is a major component of the selenium architecture
it provide a programming interface between the language and web browser so it is like a medium where we interact with the programming, it talk programming language to the web browser
and web browser to programming languages. it is composed of selenium client library, selenium API, JSON wire Protocol, web browser drivers and browsers

selenium client library:
1. it is consist of languages like binding or commands which you will be using to write in your automation script, either to open a web browser or to click on something
or to do search like get the link of the URL.
2. It is basically contain all the commands or all the functions that we will using on our programming languages just to do the 
specific actions.
3. They are compatible with W3C protocols like HTTP, TCP and all other protocols.
4. They are the wrappers which send the script commands to the network for execution into a web-browser. so basically there are the one who tell to web browser that
what should do. it will tell the way that the browser understand. for example IF I want to open the HTTPS or HTTP or I want to sent the E-mail or I want sent the file
or something, so we have to know the exactly commands and syntax.

selenium API:
1. It is a set of rules and regulations which your Python program uses to communicate with each other, for example If I use Java
or Python how the selenium going to interact or communicate with java or Python, all these things are coming under the selenium API.
2. It helps in automation without the need for the user to understand what is happening in the background, so Selenium will take care of everything and we should 
not care that how these two are communicating, that is basically abstraction.

JSON Wire Protocol:
so it is basically what ever the code which we have written will be converted to JSON then it will transmitted to the web browsers then only it can be executed
that's what happened internally.
1. The commands that you write are converted into JSON which is then transmitted across the network or 
to your web-browser so that it can be executed for automation testing. 
2. The JSON requests are sent to the client using the HTTP protocol for execution.
3. It is used by the browsers also, that how usually HTTP transmitted

Web Browser Drivers:
1. It acts as a bridge between the Selenium script, libraries and the browsers itself, lets say google chrome these act between the selenium script and the library
2. It helps us to run the selenium commands on the web-browser.
3. you have to install the web browser drivers depend on which browser that your are going to use, for example you have to install the geckodriver for Mozilla fire fox
4. install the stable driver for google chrome
5. install the latest driver for Microsoft edge


Browsers:
1. All the web-browsers

Selenium Grid:
1. It is used to run parallel tests on multiple devices running different browsers at different geographical locations. for we could run it same time on 20 or 30 devices
and it will run simultaneously on same devices.
2. We can run multiple test-cases simultaneously at the same time.
3. It used the Master-Slave Architecture. it is like server and client basically

this is the command to install selenium and web driver manager:

pip install selenium

pip install webdriver-manager

2) What is the significant of the Python Virtual Environment? give some example in support of your answer:
The primary significance of using virtual environments in Python is to isolate dependencies and project-specific packages, 
avoiding conflicts between different projects and maintaining a clean and reproducible development environment. 

Virtual Environment: 
it is copy of the python interpreter and It is a tool which helps Python Developers and Testers to keep project dependencies and modules which are required for different projects separate and independent of each other
With this we can manage our projects and its dependencies far more efficiently and easily.

How to create virtual Environments:

Venv:
Create a virtual environment:
			Python -m venv .folder (venv)
Activate the virtual environment:
.venv\Scripts\activate
.venv\Scripts\python
Deactivate the virtual environment:
		deactivate

virtualenv:

Install the virtualenv:
pip install virtualenv

Create the Python Virtual Environment:
		Virtualenv <name of the project>

Activate your Python Virtual Environment:
		Scripts\activate

Deactivate your python Virtual Environment:
Scripts\deactivate