TestNG Testing Tutorial Home / Video /

TestNG Tutorial With Selenium | How To Handle Dynamic Waits In Selenium⏳| Part-VII | LambdaTest

TestNG Tutorial With Selenium | How To Handle Dynamic Waits In Selenium⏳| Part-VII | LambdaTest

...Playlist

...
  • Learn TestNG in 5 Hours | Complete TestNG Tutorial With Selenium 🎯
  • TestNG Tutorial With Selenium | What Is TestNG🔍| Part-I
  • TestNG Tutorial With Selenium | Annotations In TestNG🔍| Part-II
  • TestNG Tutorial With Selenium | Writing First Test In Selenium With TestNG🔍| Part-III
  • TestNG Tutorial With Selenium | What Are Assertions in TestNG❓| Part-IV
  • TestNG Tutorial With Selenium | Parameterization in TestNG | Part-V
  • TestNG Tutorial With Selenium | Capturing Screenshot Of Failed Tests | Part-VI
  • TestNG Tutorial With Selenium | How To Handle Dynamic Waits In Selenium ⏳| Part-VII
  • TestNG Tutorial With Selenium | Page Object Model 📃| Part-VIII
  • TestNG Tutorial With Selenium | How To Do Parallel Testing In TestNG 📃| Part-IX
  • TestNG Tutorial With Selenium | How To Perform Cross Browser Testing 👨‍💻| Part-X
  • TestNG Tutorial With Selenium | How To Perform Geolocation Testing 📍| Part-XI
  • How To Perform End To End Testing With Selenium | Selenium Tutorial🔍

About The Video

In this full TestNG tutorial for beginners, Rex Jones (@RexJonesII), a seasoned QA Engineer, Trainer, YouTuber, and Blogger, walks you through the TestNG framework and everything you need to know to get started with Selenium automation testing. This video also covers TestNG valuable features like grouping, dependence, prioritization, ease of using multiple annotations, etc.

Video Chapters

0:00 Introduction to Dynamic Wait Statements

0:46 Different Selenium Wait Methods

2:22 What is Explicit Wait?

12:46 What is Fluent Wait?

24:04 What is Implicit Wait?

34:08 Conclusion

Key Topics Covered

Introduction to Dynamic Wait Statements: The video starts with an explanation of why dynamic wait statements are crucial for testing web applications with dynamic content. It distinguishes dynamic waits from the inefficient Thread.sleep() method, emphasizing the importance of waiting for specific conditions rather than a fixed time.

Types of Dynamic Wait Statements in Selenium:

  • Page Load Timeout: Sets the maximum time for a page to load before throwing an exception.

  • Script Timeout: Determines the time allowed for a script to execute.

  • Implicit Wait: Configures the WebDriver to wait for a certain amount of time when trying to find an element if it's not immediately available.

  • Explicit Wait: Waits for a certain condition to occur before proceeding with the execution.

  • Fluent Wait: Allows more complex configurations, specifying the maximum amount of time to wait for a condition and the frequency with which to check the condition. It also allows ignoring specific types of exceptions while waiting.

Practical Demonstrations:

  • The tutorial includes demonstrations of three key wait strategies: Explicit Wait, Fluent Wait, and Implicit Wait. For Explicit Wait, an example is provided where the test waits for a dynamically loaded image to be displayed after clicking a button.

  • The Fluent Wait demonstration shows how to poll for a condition (such as the completion of a download progress) and print the progress percentage dynamically.

  • The Implicit Wait example illustrates how to set a global wait time that applies to all element searches, using a scenario where the test waits for a "Hello World" message to be visible after initiating a dynamic action.

Code Implementation: The video walks through the code implementation for each wait strategy, including setting up the WebDriver, navigating to the test page, finding elements, and applying the wait statements. It also shows how to use assertions to validate that the expected conditions are met.

Best Practices and Tips: Throughout the tutorial, best practices are highlighted, such as avoiding the combination of implicit and explicit waits due to potential unexpected wait times and ensuring that wait statements are appropriately used to improve test reliability and efficiency.

Related Blogs & Hubs

Selenium Waits Tutorial: Guide to Implicit, Explicit, and Fluent Waits

Selenium C# Tutorial on Explicit and Fluent Wait

Selenium C# Tutorial: Using Implicit Wait In Selenium C#

Selenium TestNG Tutorial

Rex Jones

Rex Jones

Rex is an Experienced Quality Assurance (QA) Engineer with a history of working in the IT and Services industry. Certified as a Certified Software Test Engineer (CSTE) and Test Management Approach (TMap). Also skilled in Automation, Agile Methodologies, Test Strategies, and Software Development Life Cycle (SDLC) with a passion for testing software manually or automation such as Selenium.

......
...

Testμ 2024

Join the free online conference to decode the future of testing!

...21 - 23 August, 2024

More Videos from TestNG Testing Tutorial