Skip to content
CodeKruPro

Drive a dropdown from a list of choices

Automation taskMediumPython onlyAsked in: Accenture, Capgemini, Infosys, SaaS Labs, TCS, Wipro

A data-driven twist on dropdowns: "Select each value from this list and check that the page reacts to each one." Data-driven means the same steps run once per input value. Loop over the choices and verify after every selection, not only at the end.

Drive a Dropdown from a List of Choices

Drive a Dropdown from a List of Choices

A list can drive the same steps more than once. Print each result immediately so the lines follow the list order.

Task:

  1. Loop over ["Python", "Ruby"]
  2. Select each choice in #singleSelect
  3. Print #singleSelectResult before the next choice

Print the lines below exactly.

Expected output:

Selected: Python
Selected: Ruby