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
How can you use the recovery scenario in selenium webdriver?
Can captcha and bar code reader be automated by using selenium?
Differentiate between ‘/’ and ‘//’.
How to handle dropdowns in selenium?
How will you find an element using selenium?
What is pom (page object model)?
How to use regular expressions in selenium?
What are the operating systems supported by selenium webdriver?
How many types of webdriver api's are available in selenium?
How to login to any site if it’s showing any authentication popup for
What are the advantages of selenium grid?
Write the code for reading and writing to excel through selenium?
What is the difference between borland silk and selenium?
How to capture screenshot in selenium webdriver?
How to enter text in the HTML text box without invoking the SendKeys ()?