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
What are some of the different ways to find an element using selenium as a tool?
What are the capabilities of selenium webdriver or selenium 2.0?
Can captcha and bar code reader be automated by using selenium?
What are selenium tests normally named (as displayed at the top of each test when viewed from within a browser)?
What is actions class in webdriver
Name an api used for logging in java?
What is the use of logging in automation?
Explain how to assert text of webpage using selenium 2.0?
How you can insert a break point in selenium ide?
List the different types of locaters in selenium.
What are the verification points available in selenium?
What is the selenium webdriver?
What is the difference between “type” and “typeandwait” command?
When we use findElement () and findElements () findElement ()?
Why should testers opt for selenium and not qtp?