synchronization issue

Synchronization is very common issue in testing enviroment.
SYNCHRONIZATION means moving, working, acting together
so We want the webdriver and the browser to be synchronized.

First thing to handle synchronization issue is

THREAD.SLEEP
Coming from JAVA, not Selenium.
 - Stops the execution of the code with no conditions checked.
 - If we say wait for 10 seconds, it will stop the execution of the whole code
for 10 seconds.
 - It is not considered a good practice to use Thread.sleep.
 - i don't use it since help makes execution longer and heavier.

 OPTION #2: Implicit Wait
 - Implicit wait is coming from selenium.
 - The default value is 0 second
 - Every time findElement, findElements method
 is used, this implicitlyWait method is triggered.
 - We set this once, and it applies to every time
 we are trying to find element.

explicit wait=
  I use it when I want to wait for specific conditions or 
  specific web elements. 
    - Such as: elementIsClickable
    - elementIsDisplayed
    - titleIs...
       - To be able to use explicit wait:
       - You need to create instance of WebDriverWait class.

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source