Bird
0
0

Which of the following is the correct syntax to create an Edge driver with options in Python Selenium?

easy📝 Syntax Q3 of 15
Selenium Python - Cross-Browser Testing
Which of the following is the correct syntax to create an Edge driver with options in Python Selenium?
Adriver = webdriver.EdgeOptions(options)
Bdriver = webdriver.EdgeOptions()
Cdriver = Edge(options)
Ddriver = webdriver.Edge(options=options)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct driver initialization syntax

    The Edge driver is created by calling webdriver.Edge() and passing the options as a named argument.
  2. Step 2: Exclude incorrect usage of EdgeOptions as driver

    EdgeOptions is for setting options, not for creating the driver directly.
  3. Final Answer:

    driver = webdriver.Edge(options=options) -> Option D
  4. Quick Check:

    Driver creation with options = webdriver.Edge(options=options) [OK]
Quick Trick: Pass options as named argument to webdriver.Edge() [OK]
Common Mistakes:
  • Trying to instantiate EdgeOptions as driver
  • Passing options without keyword 'options='
  • Using wrong class names like Edge() without webdriver

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes