Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set an implicit wait of 10 seconds.
Selenium Java
driver.manage().timeouts().implicitlyWait([1], TimeUnit.SECONDS); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a very short time like 5 seconds may cause tests to fail if elements load slowly.
Forgetting to specify the time unit as SECONDS.
✗ Incorrect
The implicit wait time is set to 10 seconds using implicitlyWait(10, TimeUnit.SECONDS).
2fill in blank
mediumComplete the code to import the correct TimeUnit class.
Selenium Java
import java.util.concurrent.[1];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing from the wrong package causes compilation errors.
Missing the import statement entirely.
✗ Incorrect
The correct import for TimeUnit is java.util.concurrent.TimeUnit.
3fill in blank
hardFix the error in the code to correctly set implicit wait.
Selenium Java
driver.manage().timeouts().implicitlyWait(10, TimeUnit.[1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or misspelled time units causes compilation errors.
Adding the class name prefix redundantly.
✗ Incorrect
The correct enum constant is SECONDS from TimeUnit. It must be uppercase without prefix.
4fill in blank
hardFill both blanks to create an implicit wait of 15 seconds.
Selenium Java
driver.manage().timeouts().implicitlyWait([1], TimeUnit.[2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using milliseconds or minutes instead of seconds.
Swapping the order of arguments.
✗ Incorrect
Implicit wait is set with 15 seconds using implicitlyWait(15, TimeUnit.SECONDS).
5fill in blank
hardFill all three blanks to set implicit wait and import the correct package.
Selenium Java
import java.util.concurrent.[1]; WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait([2], TimeUnit.[3]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing wrong classes or missing import.
Using wrong time units or values.
✗ Incorrect
Import TimeUnit, then set implicit wait to 10 seconds with implicitlyWait(10, TimeUnit.SECONDS).