Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit cc94de6

Browse files
committed
Fixed another problem in my previous patch. selectOptions: when only one value is given it referenced the label and not the value
1 parent 6a257f8 commit cc94de6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.io.InputStream;
88
import java.net.MalformedURLException;
99
import java.net.URL;
10-
import java.util.Arrays;
1110
import java.util.LinkedList;
1211
import java.util.List;
1312

@@ -411,10 +410,9 @@ public void reset() {
411410
}
412411

413412
public void selectOptions(String selectName, String[] optionsValue) {
414-
System.err.println(selectName + Arrays.toString(optionsValue));
415413
if(optionsValue.length == 1) {
416-
selenium.select("xpath=" + formSelector() + "//select[@name='" + selectName + "']",
417-
optionsValue[0]);
414+
selenium.select("xpath=" + formSelector() + "//select[@name='" + selectName + "']", "value="
415+
+ optionsValue[0]);
418416
} else {
419417
for (int i = 0; i < optionsValue.length; i++) {
420418
selenium.addSelection("xpath=" + formSelector() + "//select[@name='" + selectName + "']",

0 commit comments

Comments
 (0)