There are two approaches that are discussed below: Approach 1: First, select the options by JavaScript selector, Use value Property (eg. Instead of getting the list of all