Automation: Understanding the Complete Selenium Architecture
Get link
Facebook
X
Pinterest
Email
Other Apps
The Magic of Software Automation
Software automation almost sounds like pure magic, doesn't it? Writing just four or five lines of code that can automatically control a web browser, click buttons, and open pages all on its own! But how exactly does all of this happen? In today's explainer session, we will decode the architecture behind this automation miracle, specifically focusing on the back-end communication flow.
Introduction to Selenium Automation
When we hear the word "Software Automation," the first name that immediately comes to mind is Selenium. Here is a fun fact: Once upon a time, a tool named Mercury dominated the market. In science, Selenium is used as an antidote to mercury poisoning. As a counter to the Mercury tool, the creators playfully named their new framework "Selenium"!
Selenium is not just a single software tool that you install on your system. It is an open-source suite of tools—a framework—used to test web applications. The main reason this framework gained such massive popularity is its universal support. On one hand, you can write code in popular programming languages like Java, Python, or C#. On the other hand, you can easily run that code on any modern web browser like Chrome or Firefox. Connecting different languages to different browsers is the true strength of Selenium.
The Core Architecture
This is where the real magic begins. Normally, the code we write is not directly understood by a web browser. Therefore, we need a bridge to connect the two. This entire process happens in four stages, much like a relay race:
Client Library: Where the code is written.
W3C WebDriver Protocol: The heart of the entire system.
Browser Driver: The intermediate translator (like ChromeDriver or GeckoDriver).
Web Browser: The final destination where the action happens.
Automation is only possible when all four of these blocks sync and communicate perfectly with each other.
The Crucial W3C Protocol Flow
Our focus needs to be right here. There is one major point to note: The commands we write in Java or Python do not go directly to the browser. Instead, in milliseconds, they are converted into standard HTTP requests that the internet understands. This transformation enables communication through a standard W3C (World Wide Web Consortium) protocol.
Simply put, this acts as a universal translator, standing as a massive bridge between our code and the browser. Once the HTTP request is generated from our code, the W3C protocol swings into action. It securely routes these requests to the Browser Driver. For example, if a request reaches the ChromeDriver, it receives it, translates it into a language the Chrome browser understands, and successfully completes tasks like clicking a button.
Receiving the Response: The Reverse Journey
The command was sent, and the browser performed the task. Is the job done? No! The process we just discussed now happens in reverse. Once the task in the browser is completed, the Browser Driver first receives the status—whether it was a success or a failure.
From there, that information travels back through the same W3C protocol and returns to the Client Library. Based on this information, a "Pass" or "Fail" status is triggered in our code. The end result of this reverse journey is the Pass/Fail report printed on our system console. Automation is not just about giving commands; a developer must know the status of whether the assigned task was done correctly.
Connecting the Full Cycle
The main concept to understand here is that all of this happens in a continuous loop, according to a strict plan. The code initiates a command, the W3C protocol acts as a silent messenger carrying the data, the Driver translates the request, and the Browser executes the task and returns the answer.
If you can completely understand this back-end communication flow—especially the role of the protocol—you will undoubtedly grow into a powerful Automation Architect. Looking at this, one thing is clear: if we can control browsers so easily and precisely using a standard protocol and a few lines of code, imagine what complex digital tasks we can automate in the future! The possibilities are truly mind-blowing.
సాఫ్ట్వేర్ ఆటోమేషన్ అంటే ఒక మ్యాజిక్!
సాఫ్ట్వేర్ ఆటోమేషన్ వినడానికి అచ్చం ఒక మ్యాజిక్ లా అనిపిస్తుంది కదు! అంటే, మనం రాసే కేవలం నాలుగైదు లైన్ల కోడ్ దానంతటి అదే వెబ్ బ్రౌజర్ ని కంట్రోల్ చేయడం, బటన్స్ క్లిక్ చేయడం, పేజీలు ఓపెన్ చేయడం.. అసలు ఇదంతా ఎలా జరుగుతోంది? ఈనాటి మన ఎక్స్ప్లనర్ సెషన్ లో, ఈ ఆటోమేషన్ అద్భుతం వెనుక ఉన్న ఆర్కిటెక్చర్ ని, ముఖ్యంగా ఆ బ్యాక్ ఎండ్ కమ్యూనికేషన్ ఫ్లో ని డీకోడ్ చేద్దాం.
సెలీనియం (Selenium) ఆటోమేషన్ పరిచయం
అసలు సాఫ్ట్వేర్ ఆటోమేషన్ అనగానే మనకు వెంటనే గుర్తొచ్చే పేరు 'సెలీనియం'. ఇక్కడ ఇంట్రెస్టింగ్ ఫాక్ట్ ఏంటంటే: ఒకప్పుడు మార్కెట్ ని శాసించిన 'మెర్క్యూరీ' (Mercury) టూల్ కి కౌంటర్ గా, సైన్స్ లో మర్క్యూరీ పాయిజనింగ్ కి విరుగుడుగా పనిచేసే 'సెలీనియం' పేరుని దీనికి సరదాగా పెట్టారు!
ఇదేదో మీ సిస్టం లో ఇన్స్టాల్ చేసుకునే ఒక సింగల్ సాఫ్ట్వేర్ టూల్ కాదు. వెబ్ అప్లికేషన్స్ ని టెస్ట్ చేయడానికి వాడే ఒక ఓపెన్ సోర్స్ టూల్ సముదాయం, అంటే ఒక ఫ్రేమ్ వర్క్. దీనికి ఇంత క్రేజ్ రావడానికి మెయిన్ రీజన్ 'యూనివర్సల్ సపోర్ట్'. ఒకవైపు జావా, పైథాన్, C# లాంటి పాపులర్ ప్రోగ్రామింగ్ లాంగ్వేజెస్ లో కోడ్ రాసుకోవచ్చు, మరోవైపు ఆ కోడ్ ని క్రోమ్ (Chrome) లేదా ఫైర్ఫాక్స్ (Firefox) లాంటి ఏ మోడర్న్ వెబ్ బ్రౌజర్ లోనైనా ఈజీగా రన్ చేయొచ్చు.
కోర్ ఆర్కిటెక్చర్ (Core Architecture)
అసలు మ్యాజిక్ ఇక్కడే మొదలవుతుంది. సాధారణంగా మనం రాసే కోడ్ కి, వెబ్ బ్రౌజర్ భాష నేరుగా అర్థం కాదు. అందుకే ఈ రెండిటిని కలపడానికి ఒక బ్రిడ్జ్ కావాలి. ఈ పూర్తి ప్రాసెస్ అచ్చం ఒక రిలే రేస్ లాగా నాలుగు దశల్లో జరుగుతుంది:
క్లైంట్ లైబ్రరీ (Client Library): మనం కోడ్ రాసే ప్రదేశం.
W3C వెబ్ డ్రైవర్ ప్రొటోకాల్: ఈ మొత్తం సిస్టం కే ఇది హార్ట్ లాంటిది.
బ్రౌజర్ డ్రైవర్ (Browser Driver): మధ్యలో అనువాదకుడు.
వెబ్ బ్రౌజర్ (Web Browser): అసలు పని జరిగే ప్రదేశం.
ఈ నాలుగు బ్లాక్స్ ఒకదానితో ఒకటి మాట్లాడుకుంటూ సింక్ అయితేనే ఆటోమేషన్ సాధ్యపడుతుంది.
అత్యంత కీలకమైన W3C ప్రొటోకాల్ ఫ్లో
మనం జావా లోనో, పైథాన్ లోనో రాసిన కమాండ్స్ అన్ని నేరుగా బ్రౌజర్ కి వెళ్ళిపోవు. అవన్నీ మిల్లీ సెకండ్లలో ఇంటర్నెట్ కి అర్థమయ్యే స్టాండర్డ్ HTTP రిక్వెస్ట్ గా మారిపోతాయి. ఇలా మారటం వల్లే W3C ప్రొటోకాల్ ద్వారా కమ్యూనికేషన్ జరుగుతుంది. సింపుల్ గా చెప్పాలంటే, ఇదొక యూనివర్సల్ ట్రాన్స్లేటర్ లాగా పనిచేస్తూ మన కోడ్ కి, బ్రౌజర్ కి మధ్య ఒక పెద్ద వారధిలా నిలుస్తుంది.
కోడ్ నుంచి HTTP రిక్వెస్ట్ జనరేట్ అయ్యాక, ఈ ప్రొటోకాల్ ఆ రిక్వెస్ట్స్ ని సెక్యూర్ గా బ్రౌజర్ డ్రైవర్ కి రూట్ చేస్తుంది. ఉదాహరణకు, రిక్వెస్ట్ క్రోమ్ డ్రైవర్ (ChromeDriver) కి చేరిందనుకోండి, ఆ డ్రైవర్ దాన్ని రిసీవ్ చేసుకుని వెంటనే క్రోమ్ బ్రౌజర్ కి అర్థమయ్యే విధంగా మార్చి, బటన్స్ క్లిక్ చేయడం లాంటి టాస్క్స్ ని కంప్లీట్ చేయిస్తుంది.
రెస్పాన్స్ అందుకోవడం (The Reverse Journey)
కమాండ్ వెళ్ళింది, బ్రౌజర్ టాస్క్ చేసింది.. మరి అక్కడితో పని అయిపోయిందా? లేదు! ఇందాక జరిగిన ప్రాసెస్ ఇప్పుడు రివర్స్ లో జరుగుతుంది. బ్రౌజర్ లో పని పూర్తి కాగానే సక్సెస్ ఆ, ఫెయిల్యూరా అనే స్టేటస్ ని ముందు బ్రౌజర్ డ్రైవర్ రిసీవ్ చేసుకుంటుంది.
అక్కడి నుండి ఆ సమాచారం మళ్ళీ అదే W3C ప్రొటోకాల్ గుండా తిరిగి క్లైంట్ లైబ్రరీకి చేరుతుంది. ఈ రివర్స్ ప్రయాణం యొక్క ఎండ్ రిజల్ట్ ఏంటంటే మన సిస్టం కన్సోల్ లో ప్రింట్ అయ్యే పాస్ లేదా ఫెయిల్ రిపోర్ట్. ఆటోమేషన్ అంటే కేవలం కమాండ్స్ ఇచ్చి వదిలేయడం కాదు, ఆ పని కరెక్ట్ గా జరిగిందా లేదా అన్న స్టేటస్ డెవలపర్ కి తెలియాలి.
పూర్తి సైకిల్ కనెక్ట్ చేయడం
ఇదంతా ఒక పక్కా ప్లాన్ ప్రకారం ఒక లూప్ లాగా జరుగుతుంది. కోడ్ ఒక కమాండ్ ని స్టార్ట్ చేస్తే, మధ్యలో W3C ప్రొటోకాల్ ఒక సైలెంట్ మెసెంజర్ లాగా డేటాని మూసుకెళ్తుంది. ఆ తర్వాత డ్రైవర్ ఆ రిక్వెస్ట్ ని అనువదిస్తే, బ్రౌజర్ ఆ పనిని ఎగ్జిక్యూట్ చేసి తిరిగి ఆన్సర్ ఇస్తుంది. ఈ బ్యాక్ ఎండ్ కమ్యూనికేషన్ ఫ్లో ని ఎవరైతే పూర్తిగా అర్థం చేసుకుంటారో వాళ్లే ఒక పవర్ ఫుల్ ఆటోమేషన్ ఆర్కిటెక్ట్ గా ఎదుగుతారు!
सॉफ्टवेयर ऑटोमेशन का जादू
सॉफ्टवेयर ऑटोमेशन लगभग शुद्ध जादू जैसा लगता है, है ना? कोड की केवल चार या पांच लाइनें लिखना जो स्वचालित रूप से एक वेब ब्राउज़र को नियंत्रित कर सकती हैं, बटन क्लिक कर सकती हैं, और पृष्ठ खोल सकती हैं! लेकिन यह सब वास्तव में कैसे होता है? आज के एक्सप्लेनर सत्र में, हम इस ऑटोमेशन चमत्कार के पीछे के आर्किटेक्चर को डिकोड करेंगे, विशेष रूप से बैक-एंड कम्युनिकेशन फ्लो पर ध्यान केंद्रित करेंगे।
सेलेनियम (Selenium) ऑटोमेशन का परिचय
जब हम "सॉफ्टवेयर ऑटोमेशन" शब्द सुनते हैं, तो सबसे पहला नाम जो दिमाग में आता है वह है सेलेनियम (Selenium)। यहाँ एक दिलचस्प तथ्य है: एक समय में, मर्करी (Mercury) नामक एक टूल का बाजार पर दबदबा था। विज्ञान में, सेलेनियम का उपयोग मर्करी (पारे) के जहर के मारक (antidote) के रूप में किया जाता है। मर्करी टूल का मुकाबला करने के लिए, इसके निर्माताओं ने मज़ाकिया तौर पर अपने नए फ्रेमवर्क का नाम "सेलेनियम" रखा!
सेलेनियम सिर्फ एक सॉफ्टवेयर टूल नहीं है जिसे आप अपने सिस्टम पर इंस्टॉल करते हैं। यह वेब एप्लिकेशन का परीक्षण करने के लिए उपयोग किए जाने वाले टूल्स का एक ओपन-सोर्स सूट (फ्रेमवर्क) है। इसकी लोकप्रियता का मुख्य कारण इसका यूनिवर्सल सपोर्ट है। एक तरफ, आप जावा, पायथन या C# जैसी प्रोग्रामिंग भाषाओं में कोड लिख सकते हैं, और दूसरी तरफ, आप उस कोड को क्रोम या फ़ायरफ़ॉक्स जैसे किसी भी आधुनिक वेब ब्राउज़र पर आसानी से चला सकते हैं।
कोर आर्किटेक्चर (Core Architecture)
असली जादू यहीं से शुरू होता है। आम तौर पर, हम जो कोड लिखते हैं वह सीधे वेब ब्राउज़र को समझ में नहीं आता है। इसलिए, दोनों को जोड़ने के लिए हमें एक ब्रिज (पुल) की आवश्यकता है। यह पूरी प्रक्रिया एक रिले रेस की तरह चार चरणों में होती है:
क्लाइंट लाइब्रेरी (Client Library): जहाँ कोड लिखा जाता है।
वेब ब्राउज़र (Web Browser): अंतिम स्थान जहाँ कार्रवाई होती है।
ऑटोमेशन तभी संभव है जब ये चारों ब्लॉक एक-दूसरे के साथ पूरी तरह से सिंक और संवाद करते हैं।
महत्वपूर्ण W3C प्रोटोकॉल फ्लो
हमारा सारा ध्यान यहीं होना चाहिए। ध्यान देने योग्य एक बड़ा बिंदु है: जावा या पायथन में हम जो कमांड लिखते हैं, वे सीधे ब्राउज़र में नहीं जाते हैं। इसके बजाय, वे इंटरनेट को समझ में आने वाले HTTP अनुरोधों (Requests) में बदल जाते हैं। यह परिवर्तन एक मानक W3C प्रोटोकॉल के माध्यम से संचार को सक्षम बनाता है।
सरल शब्दों में, यह एक यूनिवर्सल अनुवादक के रूप में कार्य करता है। एक बार जब हमारे कोड से HTTP अनुरोध उत्पन्न हो जाता है, तो प्रोटोकॉल इन अनुरोधों को सुरक्षित रूप से ब्राउज़र ड्राइवर तक पहुँचाता है। उदाहरण के लिए, यदि अनुरोध क्रोमड्राइवर तक पहुँचता है, तो वह उसे प्राप्त करता है, उसे ऐसी भाषा में अनुवादित करता है जिसे क्रोम ब्राउज़र समझता है, और कार्य पूरा करता है।
प्रतिक्रिया प्राप्त करना (The Reverse Journey)
कमांड भेजा गया, और ब्राउज़र ने कार्य किया। क्या काम हो गया? नहीं! अभी हमने जिस प्रक्रिया पर चर्चा की, वह अब विपरीत दिशा (Reverse) में होती है। ब्राउज़र में कार्य पूरा होने के बाद, ब्राउज़र ड्राइवर सबसे पहले स्थिति (Status) प्राप्त करता है - कि यह सफल रहा या विफल।
वहाँ से, वह जानकारी उसी W3C प्रोटोकॉल के माध्यम से वापस यात्रा करती है और क्लाइंट लाइब्रेरी में लौट आती है। इसी जानकारी के आधार पर, हमारे कोड में "पास" या "फेल" रिपोर्ट जनरेट होती है। ऑटोमेशन का मतलब सिर्फ कमांड देना नहीं है; डेवलपर को यह जानना चाहिए कि दिया गया काम सही तरीके से हुआ या नहीं।
पूरे चक्र को जोड़ना
यहाँ समझने वाली मुख्य बात यह है कि यह सब एक योजना के अनुसार लूप में होता है। कोड एक कमांड शुरू करता है, W3C प्रोटोकॉल एक मूक संदेशवाहक के रूप में डेटा ले जाता है, ड्राइवर अनुरोध का अनुवाद करता है, और ब्राउज़र कार्य निष्पादित करके उत्तर लौटाता है। यदि आप इस बैक-एंड संचार प्रवाह को पूरी तरह से समझ सकते हैं, तो आप निश्चित रूप से एक शक्तिशाली ऑटोमेशन आर्किटेक्ट बन जाएंगे!
Explore Related Topics:
Selenium ArchitectureSoftware AutomationWhat is SeleniumSelenium WebDriverW3C ProtocolSelenium in TeluguAutomated TestingSoftware TestingClient LibraryBrowser DriverChromeDriverSelenium Backend FlowSelenium WebDriver ArchitectureQA AutomationTesting FrameworksWeb Application TestingSelenium with JavaSelenium with PythonHTTP Requests in SeleniumOpen Source TestingIT Tutorials TeluguSelenium ExplanationCross Browser TestingAutomation Architect7Hills AutomationQuality AssuranceTest AutomationSelenium CommandsWeb Automation ToolsTechnology Explained
Now, we are going to learn very interesting and Most important in Linux Why late lets know about Awk command,one of the mostly used command in scripting. awk command used to manipulate data | using this AWK command we can generate specified reports as per our requirement. Syntax : awk ‘BEGIN {start_action} {action} END {stop_action}’ filename let me explain about awk command with simple examples Example 1: How to print entire data of the file cat filename | awk '{print}' cat filename | awk '{print$0}' both " awk '{print}' and awk '{print$0}' " used to print entire date Example 2: How to print very first column cat filename| awk '{print$1}' awk '{print$1}' used to print very first column awk '{print$1}' used to print second column Example 3: How to print p attern Matching Technique in Awk. free -m | awk '{/Mem/print}' here, we are matching Mem using awk '{...
Hello, Here we are going to learn complete Linux course freely & Simply way. Why Linux? Linux is an heart the operating system, Based on the Linux Kernel their are different types of Linux flavors available i.e.. RedHat, Centos, Fedora, Mint Debian, Kali, OpenSUSE...etc Features of Linux Open source. Multi-user. Multitasking. Hierarchical file system. Portable. Wide hardware support. No need to worry, we explained each and every topic clearly just click on the below links for watch on Youtube. 1. Linux outline in Telugu 2. Linux introduction In Telugu 3. Linux architecture In Telugu 4. Linux Directory Structure In Telugu 5. Linux Basic Commands In Telugu 6. ...
Hey! Well come back! Here, we are going to learn very useful command rsync. basically rsync is used to sync file system with same structure. It also used to data backup/copy. rsync is free command line utility & In most of the system it available defiantly. We can install rsync utility in debian based system using below command apt-get install rsync We can install rsync utility in redhat based system using below command yum install rsync Below command used to copy files without using option rsync /root/Desktop/original/* /root/Desktop/backup/ Below command used for recursive copy, it means with sub folders. rsync -avhr /root/Desktop/original/* /root/Desktop/backup/ Here -a is used for archive data. -v is used for show output. -h is used for show copied data in MB's,it means human readable format. Below command used for include or exclude rsync -avz --in...
Now we are going to learn very useful & interesting topic "How to reduce/extend LVM size" with real time example.hope this article very helpful for you. For example scenario, I have added some storage space to linux machine,we need to scan hosts to display in linux machine, we can scan all hots/LUN's by using below commands at the time. ------------------------------------------------------ Use below command to scan hosts/LUN's. ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done Use below command to verify newly added device/stroage #lsblk Use below command to format /dev/sdb #fdisk /dev/sdb Below commands helpful for complete format. #n #p enter enter #t #8e p #wq Below command used to update partition info to kernal. partprobe /dev/sdb1 try below command to create pv(Physical volume) #pvcreate /dec/sdb1 Try below command to create volume group #vgcreate VG0...
Comments
Post a Comment