0

I have Select box with 40 options. I want to download file after selecting all those 40 options. Now I am using a loop to iterate each element then downloads the file. Since I am using Firefox web-driver and selenium and Python It's very time consuming while it works fast in Chrome Web-driver. But file doesn't download in headless mode in Chrome Web-driver. So I decided to go with Firefox. I tried other stack-overflow answers but couldn't achieve my goal.

So Can anyone tell me how to select all options in drop-down at once by selecting first option and then drag till last option ?

EDITED: I want to select All items at once not one by one manually.

Currently I am doing like this:-

dropdown_options = select_box.options

select_box = Select(driver.find_element_by_xpath("//select[@id='shipStatusIdList']"))
x=[select_box.select_by_index(ele_index) for ele_index in range(len(dropdown_options)) ]


    <option value="AT_STATION">At Station</option>   
                <option value="AT_WRONG_STATION">At Wrong Station</option>   
                <option value="BETWEEN_FC_AND_STATIONS">Between FC/SC and Stations</option>   
                <option value="BETWEEN_STATIONS">Between Stations</option>   
                <option value="CANCELLED">Cancelled</option>   
                <option value="CASH_AT_STATION">Cash at Station</option>   
                <option value="CASH_RECEIVED_IN_THE_BANK">Cash in Bank</option>   
                <option value="CASH_IN_TRANSIT_BETWEEN_STATION_AND_BANK">Cash in transit to bank</option>   
                <option value="CASH_IN_ASSOCIATE">Cash with Associate</option>   
                <option value="DELAYED">Delayed</option>   
                <option value="DELAYED_AT_STATION">Delayed / At Station</option>   
                <option value="DELIVERED">Delivered</option>   
                <option value="DELIVERY_ATTEMPTED">Delivery Attempted</option>   
                <option value="DEPARTED_FOR_FC">Departed For FC/SC</option>   
                <option value="DROPPED_AT_ORDT">Dropped At ORDT</option>   
                <option value="DROPPED_AT_STORE">Dropped At Store</option>   
                <option value="HOLD_FOR_CUSTOMER_REQUEST">Hold for Customer Request</option>   
                <option value="HOLD_FOR_PICKUP">Hold for Pickup</option>   
                <option value="HOLD_FOR_REDELIVERY">Hold for Redelivery</option>   
                <option value="IN_TRANSIT_TO_ORDT">In Transit To ORDT</option>   
                <option value="IN_TRANSIT_TO_STORE">In Transit To Store</option> 
.
.
.
.

till 40 options.

enter image description here

Subham
  • 671
  • 9
  • 23

0 Answers0