Bird
0
0

Which of the following is a valid Python Selenium code snippet to pause the test for manual CAPTCHA solving?

easy📝 Syntax Q12 of 15
Selenium Python - Advanced Patterns
Which of the following is a valid Python Selenium code snippet to pause the test for manual CAPTCHA solving?
Atime.sleep(30)
Bdriver.wait(30)
Cdriver.pause(30)
Dsleep(30)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct pause method in Python

    Python's standard way to pause execution is using time.sleep(seconds), so time.sleep(30) pauses for 30 seconds.
  2. Step 2: Check Selenium driver methods

    Selenium WebDriver does not have pause() or wait() methods directly; wait() is for conditions, not fixed sleep.
  3. Final Answer:

    time.sleep(30) -> Option A
  4. Quick Check:

    Pause test with time.sleep() = C [OK]
Quick Trick: Use time.sleep(seconds) to pause in Python Selenium [OK]
Common Mistakes:
  • Using driver.pause() which doesn't exist
  • Calling sleep() without importing time
  • Confusing wait() with sleep()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes