Add missing override annotations in Select class
@@ -59,6 +59,7 @@ public Select(WebElement element) {
* @return Whether this select element support selecting multiple options at the same time? This
* is done by checking the value of the "multiple" attribute.
*/
+ @Override
public boolean isMultiple() {
return isMulti;
}
@@ -66,6 +67,7 @@ public boolean isMultiple() {
/**
* @return All options belonging to this select tag
*/
+ @Override
public List<WebElement> getOptions() {
return element.findElements(By.tagName("option"));
}
@@ -73,6 +75,7 @@ public boolean isMultiple() {
/**
* @return All selected options belonging to this select tag
*/
+ @Override
public List<WebElement> getAllSelectedOptions() {
List<WebElement> toReturn = new ArrayList<>();
@@ -90,6 +93,7 @@ public boolean isMultiple() {
* normal select)
* @throws NoSuchElementException If no option is selected
*/
+ @Override
public WebElement getFirstSelectedOption() {
for (WebElement option : getOptions()) {
if (option.isSelected()) {
@@ -171,6 +175,7 @@ private String getLongestSubstringWithoutSpace(String s) {
* @param index The option at this index will be selected
* @throws NoSuchElementException If no matching option elements are found
*/
+ @Override
public void selectByIndex(int index) {
String match = String.valueOf(index);
@@ -192,6 +197,7 @@ public void selectByIndex(int index) {
* @param value The value to match against
* @throws NoSuchElementException If no matching option elements are found
*/
+ @Override
public void selectByValue(String value) {
List<WebElement> options = element.findElements(By.xpath(
".//option[@value = " + Quotes.escape(value) + "]"));
@@ -215,6 +221,7 @@ public void selectByValue(String value) {
*
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
*/
+ @Override
public void deselectAll() {
if (!isMultiple()) {
throw new UnsupportedOperationException(
@@ -236,6 +243,7 @@ public void deselectAll() {
* @throws NoSuchElementException If no matching option elements are found
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
*/
+ @Override
public void deselectByValue(String value) {
if (!isMultiple()) {
throw new UnsupportedOperationException(
@@ -262,6 +270,7 @@ public void deselectByValue(String value) {
* @throws NoSuchElementException If no matching option elements are found
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
*/
+ @Override
public void deselectByIndex(int index) {
if (!isMultiple()) {
throw new UnsupportedOperationException(
@@ -289,6 +298,7 @@ public void deselectByIndex(int index) {
* @throws NoSuchElementException If no matching option elements are found
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
*/
+ @Override
public void deselectByVisibleText(String text) {
if (!isMultiple()) {
throw new UnsupportedOperationException(
