View all questions & answers for the CPST-001 exam
While executing a test case, you encounter a NoSuchElementException. How would you handle this exception?
Use WebDriverWait to wait for the element to be present before performing any action.
Use a custom exception handler to retry finding the element multiple times.
Use a try-catch block to catch the exception and handle it by logging an error message.
Use the NoSuchElementException class methods to recover from the exception.
Submit