Selenium Architecture...
Published: 2023-10-03 19:54:19

## selenium architecture have four component:

1. selenium IDE
2. selenium RC
3. selenium WebDriver
4. selenium Grid

1.selenium IDE:
 - selenium integrated development environment.it was created by shinya kasatani of japan.
- it is a Firefox plugin it allows developer to record and playback scripts.
- it does not require any programming language to use selenium IDE.

2.selenium RC:
- selenium Remote control it also called selenium1 because it is first web automation testing frame work .it supports many programming language and browser also. its automation function on java Script. later selenium RC was merged with selenium web driver and formed selenium 2.

3.selenium WebDriver:
- it is a automation framework allows automating user action with browser and communication with browsers through set of open-source Api.
-supported operating system by selenium web driver: Mac, windows, Linux, Solaris
-supported programming languages: python, c#, java, ruby, php, java script.
-web Browsers supports by web driver: Google Chrome, Firefox, Microsoft Edge, opera, Android, IOS.
- its again upgraded to selenium 3 and now we using selenium 4.13.0.

4.selenium Grid:
- it is used to run parallel test cases machines against parallel supported browsers.
-it is used to run numerous tests simultaneously on different OS with different browsers.

Selenium Architecture:

selenium 3 architecture:
client  ---->      Json  --->  Browser Driver  --->   Browser
library            wire  
                  protocol

client library:
-automation scripts that interact with selenium framework through selenium web driver.
-it consists of various language libraries like python, java, c#. 
-it contains a methods and classes of web driver required to create test automation scripts.
-it is not a testing framework but it provides an Application programming interface.

json wire protocol:
-java script object notation is used to data interchange format subset for java script language.
-in selenium3 json is used to communicate between selenium client library and browser drivers.
-it provides support of data structure to read and write more comfortable.

Browser Driver:
-it is bridge between client library and browsers. we have unique browser driver to take command from selenium test script and passes them respective browser.

selenium automation is started,
-test command generate corresponding http request using json wire protocol and its sent to browser driver.
-it send to http server directly drives to command execution on browser
-browser then send back test status to http server
-browser driver permit communication between selenium client library and browser.

selenium architecture 4:
 
client     ---->     Browser Driver      --->   Browser
library     <---


-in this selenium 4 we replacing json wire protocol with W3C(world wide web consortium) .
- while using selenium 4 test execution, exception handling are easy and faster we done it.
-we do not need any mediator to communicate in between selenium client library and web drivers.
-we using w3c protocol automation scripts can directly communicate with browsers.


2.significance of python virtual environment:
 i. isolation:
-it create isolation environments in python project.it means different version of python and libraries installed in other environments without interfacing each other.
example:
-if we have project 1 in python 3.3 version with their respective library and project 2 in python 3.7 version and their libraries.
-we created two separate virtual environments, we can work with each project without conflict.

ii. Dependency management:
-virtual environments helps to manage  project specific dependency.
example:
-project 1 using selenium 3 and project 2 using selenium 4.we can install appropriate selenium version for each project and prevent conflicts.

iii. version control:
-it allows to specific and version control the exact dependencies needed to run project.

iv. portability:
-it can be easily copied and moved to another system, it easier to transfer your project along with their dependencies to different environments and servers.
 example:
     -we create test cases in Pytest in local machine and we want to deploy in testing server. we can create virtual environment and install necessary dependencies and transfer environment to the server.