Skip to content
CodeKruPro

Cookies in Selenium Python

QuizEasy-MediumPython onlyAsked in: Infosys

Which statement about cookies in Selenium Python is true?

  • driver.add_cookie({"name": "k", "value": "v"}) adds one; driver.get_cookie("k") returns a dict, or None after driver.delete_cookie("k")
  • driver.add_cookie("k", "v") with two strings
  • get_cookie raises an error for a missing name
  • You can add cookies before opening any page

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in