Selenium architecture explains how your Python test script communicates with a web browser (like Chrome, Firefox) to automate actions.
🔹 Python Selenium Architecture
Python Selenium architecture explains how your automation code talks to a web browser and controls it to perform actions like clicking, typing, and navigating.
🔹 1) Python Test Script (Your Code)
This is the code you write using Python.
It contains your test steps
Uses the Selenium WebDriver library
Example tasks:
Open a website
Click a button
Enter text
👉 In simple words:
You are giving instructions to the browser through Python.
🔹 2) WebDriver (Middle Layer)
WebDriver acts like a bridge between your Python code and the browser.
Takes your commands
Converts them into a format the browser can understand
Sends them forward
👉 Think of it like a translator.
🔹 3) Communication Protocol (W3C / JSON)
Selenium uses a standard protocol to communicate
Commands are converted into JSON format
Sent over HTTP
👉 Example:
“Open…