SlideShare a Scribd company logo
Synchronization in Selenium WebDriver
1. What is Synchronization.
2. Why Synchronization is required.
3. When Synchronization is required.
4. Conditional and Unconditional Synchronization in Selenium WebDriver.
Synchronization in Selenium WebDriver
• It is a mechanism which involves more than one components to work parallel with Each other.
Generally in Test Automation, we have two components
1. Application Under Test.
2. Test Automation Tool.
• Both these components will have their own speed. We should write our scripts in such a way that both
the components should move with same and desired speed, so that we will not encounter "Element Not
Found" errors which will consume time again in debugging.
• It is a process of coordinating or matching two or more activities/devices/processes in time.
• Process of matching the speed of AUT(Application under test) & Test tool in order to get proper
execution.
• During the test execution Test tool gives instructions one by one with same speed, but AUT takes less
time for some steps execution and more time for some steps execution, in order to keep them in sync
then Synchronization is required.
• Whenever any step required time more than Synchronization time for execution, then Synchronization
is required.
Synchronization in Selenium WebDriver
Unconditional Conditional Synchronization
Implicit WaitThread.Sleep() Fluent Wait PageLoadTimeOutExplicit Wait
An implicit wait tells
WebDriver to poll the
DOM for a certain
amount of time when
trying to find an element
or elements if they are
not immediately
available.
An explicit wait
represents defined code
for certain conditions or
behaviors to occur/
happen before continued
to the next step.
The pageLoadTimeout limit
s the time that the script
allots for a web page to be
displayed. If the page loads
within the time then the
script continues. If the page
does not load within the
timeout the script will be
stopped by
a TimeoutException.
Thread.sleep method is
used to pause the
execution for defined
time. Time is defined in
milliseconds for this
method.
The fluent wait is used to
tell the web driver to wait
for a condition, as well as
the frequency with which
we want to check the
condition before throwing
an
"ElementNotVisibleExcept
ion" exception.
Thread.Sleep:
• Thread.sleep method is used to pause the execution for defined time. Time is defined in milliseconds for this method.
Implicit Wait:
• During Implicit wait if the Web Driver cannot find it immediately because of its availability, it will keep polling the DOM to get
the element.
• If the element is not available within the specified Time an NoSuchElementException will be raised.
• The default setting is zero.
• Once we set a time, the Web Driver waits for the period of the WebDriver object instance.
Explicit Wait:
• There can be instance when a particular element takes more than a minute to load.
• In that case you definitely not like to set a huge time to Implicit wait, as if you do this your browser will going to wait for the
same time for every element.
• To avoid that situation you can simply put a separate time on the required element only.
• By following this your browser implicit wait time would be short for every element and it would be large for specific element.
Fluent Wait:
• Let’s say you have an element which sometime appears in just 1 second and some time it takes minutes to appear.
• In that case it is better to use fluent wait, as this will try to find element again and again until it find it or until the final timer
runs out.
Page Load Time Out:
• The pageLoadTimeout limits the time that the script allots for a web page to be displayed.
• If the page loads within the time then the script continues.
• If the page does not load within the timeout the script will be stopped by a TimeoutException.

More Related Content

What's hot

Waits in Selenium | Selenium Wait Commands | Edureka
Waits in Selenium | Selenium Wait Commands | EdurekaWaits in Selenium | Selenium Wait Commands | Edureka
Waits in Selenium | Selenium Wait Commands | Edureka
Edureka!
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
Cuelogic Technologies Pvt. Ltd.
 
Selenium
SeleniumSelenium
Selenium
Kalyan ch
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
Knoldus Inc.
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
Qwinix Technologies
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Anirudh Raja
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
Levon Apreyan
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
Vijay Krishnan Ramaswamy
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Edureka!
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
Kerry Buckley
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Archana Krushnan
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseCypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests course
Narayanan Palani
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
Ramesh Krishnan Ganesan
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Naga Dinesh
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 

What's hot (20)

Waits in Selenium | Selenium Wait Commands | Edureka
Waits in Selenium | Selenium Wait Commands | EdurekaWaits in Selenium | Selenium Wait Commands | Edureka
Waits in Selenium | Selenium Wait Commands | Edureka
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseCypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests course
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 

Similar to Synchronization in Selenium WebDriver

Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Sargis Sargsyan
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
SQALab
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Amr E. Mohamed
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
Ducat
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautiful
Meaghan Lewis
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pages
Aditya Singh
 
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
Agile Testing Alliance
 
Build Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumBuild Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with Selenium
TechWell
 
How to make your functional tests really quick
How to make your functional tests really quickHow to make your functional tests really quick
How to make your functional tests really quick
Mikalai Alimenkou
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - Habilelabs
Habilelabs
 
Web driver selenium simplified
Web driver selenium simplifiedWeb driver selenium simplified
Web driver selenium simplified
Vikas Singh
 
Entity framework advanced
Entity framework advancedEntity framework advanced
Entity framework advanced
Usama Nada
 
Diesel load testing tool
Diesel load testing toolDiesel load testing tool
Diesel load testing tool
Syed Zaid Irshad
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
MuhammadBilal187526
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
onlinemindq
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
onlinemindq
 
Maximizing Optimizely Website Performance
Maximizing Optimizely Website PerformanceMaximizing Optimizely Website Performance
Maximizing Optimizely Website Performance
Optimizely
 
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
Thecreating Experts
 

Similar to Synchronization in Selenium WebDriver (20)

Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautiful
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pages
 
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
#ATATalk - Episode 1 : Session on Selenium Exceptions by Pallavi Sharma
 
Build Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumBuild Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with Selenium
 
How to make your functional tests really quick
How to make your functional tests really quickHow to make your functional tests really quick
How to make your functional tests really quick
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - Habilelabs
 
Web driver selenium simplified
Web driver selenium simplifiedWeb driver selenium simplified
Web driver selenium simplified
 
Entity framework advanced
Entity framework advancedEntity framework advanced
Entity framework advanced
 
Diesel load testing tool
Diesel load testing toolDiesel load testing tool
Diesel load testing tool
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
 
Maximizing Optimizely Website Performance
Maximizing Optimizely Website PerformanceMaximizing Optimizely Website Performance
Maximizing Optimizely Website Performance
 
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
 

Recently uploaded

UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 

Recently uploaded (20)

UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 

Synchronization in Selenium WebDriver

  • 1. Synchronization in Selenium WebDriver 1. What is Synchronization. 2. Why Synchronization is required. 3. When Synchronization is required. 4. Conditional and Unconditional Synchronization in Selenium WebDriver.
  • 2. Synchronization in Selenium WebDriver • It is a mechanism which involves more than one components to work parallel with Each other. Generally in Test Automation, we have two components 1. Application Under Test. 2. Test Automation Tool. • Both these components will have their own speed. We should write our scripts in such a way that both the components should move with same and desired speed, so that we will not encounter "Element Not Found" errors which will consume time again in debugging. • It is a process of coordinating or matching two or more activities/devices/processes in time. • Process of matching the speed of AUT(Application under test) & Test tool in order to get proper execution. • During the test execution Test tool gives instructions one by one with same speed, but AUT takes less time for some steps execution and more time for some steps execution, in order to keep them in sync then Synchronization is required. • Whenever any step required time more than Synchronization time for execution, then Synchronization is required.
  • 3. Synchronization in Selenium WebDriver Unconditional Conditional Synchronization Implicit WaitThread.Sleep() Fluent Wait PageLoadTimeOutExplicit Wait An implicit wait tells WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. An explicit wait represents defined code for certain conditions or behaviors to occur/ happen before continued to the next step. The pageLoadTimeout limit s the time that the script allots for a web page to be displayed. If the page loads within the time then the script continues. If the page does not load within the timeout the script will be stopped by a TimeoutException. Thread.sleep method is used to pause the execution for defined time. Time is defined in milliseconds for this method. The fluent wait is used to tell the web driver to wait for a condition, as well as the frequency with which we want to check the condition before throwing an "ElementNotVisibleExcept ion" exception.
  • 4. Thread.Sleep: • Thread.sleep method is used to pause the execution for defined time. Time is defined in milliseconds for this method. Implicit Wait: • During Implicit wait if the Web Driver cannot find it immediately because of its availability, it will keep polling the DOM to get the element. • If the element is not available within the specified Time an NoSuchElementException will be raised. • The default setting is zero. • Once we set a time, the Web Driver waits for the period of the WebDriver object instance. Explicit Wait: • There can be instance when a particular element takes more than a minute to load. • In that case you definitely not like to set a huge time to Implicit wait, as if you do this your browser will going to wait for the same time for every element. • To avoid that situation you can simply put a separate time on the required element only. • By following this your browser implicit wait time would be short for every element and it would be large for specific element. Fluent Wait: • Let’s say you have an element which sometime appears in just 1 second and some time it takes minutes to appear. • In that case it is better to use fluent wait, as this will try to find element again and again until it find it or until the final timer runs out. Page Load Time Out: • The pageLoadTimeout limits the time that the script allots for a web page to be displayed. • If the page loads within the time then the script continues. • If the page does not load within the timeout the script will be stopped by a TimeoutException.