Identify the correct syntax to select the “Mercedes” option for the below line of code. (Consider driver instance has been created and opened the application of the page)

<label for="cars">Choose a car:</label>
<select id="cars">
  <option value="1">Volvo</option>
  <option value="2">Saab</option>
  <option value="3">Mercedes</option>
  <option value="4">Audi</option>
</select>

Dropdown=browser.find_element_by_id("cars") select_car=Select(Dropdown) select_car.select_by_value("3")
Dropdown=browser.find_element_by_id("cars") select_car=Select(Dropdown) select_car.select_by_index("2")
Dropdown=browser.find_element_by_id("cars") select_car=Select(Dropdown) select_car.select_by_value(3)
Dropdown=browser.find_element_by_id("cars") select_car=Select(Dropdown) select_car.select_by_index(3)
Verified Answer
Correct Option - a

To get all Infosys Certified Selenium with Python Automation Tester Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram