Skip to content

Commit

Permalink
Documenting exceptions. Fixes issue 8090
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Oct 29, 2014
1 parent 4c3c150 commit 1cf9853
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions java/client/src/org/openqa/selenium/support/ui/Select.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public List<WebElement> getAllSelectedOptions() {
/**
* @return The first selected option in this select tag (or the currently selected option in a
* normal select)
* @throws NoSuchElementException If no option is selected
*/
public WebElement getFirstSelectedOption() {
for (WebElement option : getOptions()) {
Expand All @@ -105,6 +106,7 @@ public WebElement getFirstSelectedOption() {
* &lt;option value="foo"&gt;Bar&lt;/option&gt;
*
* @param text The visible text to match against
* @throws NoSuchElementException If no matching option elements are found
*/
public void selectByVisibleText(String text) {
// try to find the option via XPATH ...
Expand Down Expand Up @@ -165,6 +167,7 @@ private String getLongestSubstringWithoutSpace(String s) {
* element, and not merely by counting.
*
* @param index The option at this index will be selected
* @throws NoSuchElementException If no matching option elements are found
*/
public void selectByIndex(int index) {
String match = String.valueOf(index);
Expand All @@ -191,6 +194,7 @@ public void selectByIndex(int index) {
* &lt;option value="foo"&gt;Bar&lt;/option&gt;
*
* @param value The value to match against
* @throws NoSuchElementException If no matching option elements are found
*/
public void selectByValue(String value) {
StringBuilder builder = new StringBuilder(".//option[@value = ");
Expand Down Expand Up @@ -237,6 +241,7 @@ public void deselectAll() {
* &lt;option value="foo"&gt;Bar&lt;/option&gt;
*
* @param value The value to match against
* @throws NoSuchElementException If no matching option elements are found
*/
public void deselectByValue(String value) {
StringBuilder builder = new StringBuilder(".//option[@value = ");
Expand All @@ -255,6 +260,7 @@ public void deselectByValue(String value) {
* element, and not merely by counting.
*
* @param index The option at this index will be deselected
* @throws NoSuchElementException If no matching option elements are found
*/
public void deselectByIndex(int index) {
String match = String.valueOf(index);
Expand All @@ -273,6 +279,7 @@ public void deselectByIndex(int index) {
* &lt;option value="foo"&gt;Bar&lt;/option&gt;
*
* @param text The visible text to match against
* @throws NoSuchElementException If no matching option elements are found
*/
public void deselectByVisibleText(String text) {
StringBuilder builder = new StringBuilder(".//option[normalize-space(.) = ");
Expand Down

0 comments on commit 1cf9853

Please sign in to comment.