I've been using this with select-lists that support multiple selections.
It tries to mimic the behavior of assertSelectOptions - but for
*selected* SelectOptions.  If it's generally useful, perhaps a more
javascript-aware person could tighten it up

//  Verify selected options in list
//  --  selected: sorted comma-separated list of options
Selenium.prototype.assertSelectedOptions = function(target, selected) {
  var element = this.page().findElement(target);

  var expSelectedLabels = selected.parseCSV();

  var n=0
  for (var i = 0; i < element.options.length; i++) {
    if (element.options[i].selected) {
      Assert.matches(expSelectedLabels[n], element.options[i].text);
      n++;
    }
  }
}
_______________________________________________
Selenium-devel mailing list
Selenium-devel@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel

Reply via email to