I was expecting it to be mush easier but it didn't turn out to be.
I had zeroed in on getSelectedLabels method to retrieve values from a drop down but it always happned to return only first value and not whole set of values of drop down list.
I got it done by evaluating java script as following -
*******************************************************************************************************************************************
String script = "var optionElements = new Array();";
script += "var links = window.document.getElementsByTagName('form')[0].getElementsByTagName('select')[1].length;";
script += "for(var i=0; i<links; i++)";
script += "optionElements[i] = window.document.getElementsByTagName('form')[0].getElementsByTagName('select')[1][i].innerHTML;";
script += "optionElements.toString();";
String optionElements = selenium.getEval(script);
*******************************************************************************************************************************************
I would be willing to know if there is another approcah to do this.
Regards,
Tarun K
Probably I haven't got the point, but why don't you use selenium.getSelectOptions() ?
You can use the following XPath expression to get all the available items from the combo list.
id('select')/descendant::*
-Haroon
Thanks. I am yet to get used to finding easier ways of doing things!!!
~ Tarun K
