Bird
0
0

Which method is used to add arguments like '--headless' to the Edge browser in Selenium?

easy📝 Conceptual Q2 of 15
Selenium Python - Cross-Browser Testing
Which method is used to add arguments like '--headless' to the Edge browser in Selenium?
Aset_argument()
Badd_argument()
CaddArguments()
Dappend_argument()
Step-by-Step Solution
Solution:
  1. Step 1: Recall EdgeOptions method for arguments

    The correct method to add command-line arguments is add_argument().
  2. Step 2: Eliminate incorrect method names

    Methods like set_argument(), addArguments(), and append_argument() do not exist in Selenium's EdgeOptions.
  3. Final Answer:

    add_argument() -> Option B
  4. Quick Check:

    Method to add args = add_argument() [OK]
Quick Trick: Use add_argument() to pass flags like headless [OK]
Common Mistakes:
  • Using incorrect method names like set_argument
  • Confusing method casing or pluralization
  • Trying to append arguments with non-existent methods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes