difference between Implicit Wait and Explicit Wait with syntax.?

Answer Posted / surajsingh rajput

Both are part of Synchronization in Java.
there are different type of synchronization
- thread.sleep()
- Implicit wait
- Explicit wait
- Fluent wait
IMPLICIT WAIT -
we use this wait to apply globally, we can write this in our base class and use in whole framework.it is default applicable for execution of each line.
Syntax -
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

EXPLICIT WAIT -
we use this wait to apply for particular condition, we can write this in execution flow.it is applicable only for given condition and only single time per deceleration.
Syntax -
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.[CONDITION]);


Note- remember one thing implicit wait always dominates explicit wait.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you use the recovery scenario in selenium webdriver?

1188


Can captcha and bar code reader be automated by using selenium?

454


Differentiate between ‘/’ and ‘//’.

535


How to handle dropdowns in selenium?

613


How will you find an element using selenium?

483






What is pom (page object model)?

474


How to use regular expressions in selenium?

506


What are the operating systems supported by selenium webdriver?

432


How many types of webdriver api's are available in selenium?

464


How to login to any site if it’s showing any authentication popup for

502


What are the advantages of selenium grid?

496


Write the code for reading and writing to excel through selenium?

494


What is the difference between borland silk and selenium?

501


How to capture screenshot in selenium webdriver?

488


How to enter text in the HTML text box without invoking the SendKeys ()?

535