Writing bulk Weblist dropdown values to excel file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Writing bulk Weblist dropdown values to excel file

bhasu009
This post has NOT been accepted by the mailing list yet.
Hi,
In drop down there are 1500+ values(webelements). Have to select a drop down value then click a button which loads page and it displays some values say "actual values" based on the drop down selection. Now I want to write both drop down list values and actual values resulted from drop down selection to an excel file. Using TestNG Page Object Model.
-
Getting values from Down using below method
public static String[] StocksListsMethod(){
                        Select selectStock = new Select(selectStockOptionDropDown);
                        List<WebElement> listElement = selectStock.getOptions();
                        ArrayList<WebElement> listArray = new  ArrayList<WebElement>();
                        listArray.add((WebElement) listElement);//want to store into an Array List and call in other class to write to an excel file. How can this be done?

Have to store Array List and call this Array list in other class to write into an excel file.
Dropdown values
Any help will be appreciated much..