Skip to content

Commit 66c3cdd

Browse files
adding select by visible text test in example (SeleniumHQ#1136)
* file upload * implemented change on fileupload * modifeied file upload * changed selenium to Selenium for file upload * adding select by visible text text in example * adding select code in example dir for java Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> Co-authored-by: Diego Molina <diemol@users.noreply.github.com> [skip ci]
1 parent f9a2160 commit 66c3cdd

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package dev.selenium.select_element;
2+
3+
import dev.selenium.BaseTest;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.Test;
6+
import org.openqa.selenium.By;
7+
import org.openqa.selenium.Keys;
8+
import org.openqa.selenium.WebElement;
9+
import org.openqa.selenium.remote.RemoteWebDriver;
10+
import org.openqa.selenium.support.ui.Select;
11+
12+
13+
public class SelectElementTest extends BaseTest {
14+
@Test
15+
public void selectByVisibleText() {
16+
driver.get("https://www.selenium.dev/selenium/web/selectPage.html");
17+
Select dropDown = new Select(driver.findElement(By.id("selectWithoutMultiple")));
18+
dropDown.selectByVisibleText("two");
19+
Assertions.assertEquals("two",dropDown.getFirstSelectedOption().getText());
20+
}
21+
}

website_and_docs/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ theme = ["docsy"]
88

99
# Will give values to .Lastmod etc.
1010
enableGitInfo = true
11-
11+
#ignoreErrors = ["error-remote-getjson"]
1212
# Language settings
1313
# contentDir = "content/en"
1414
defaultContentLanguage = "en"

website_and_docs/content/documentation/webdriver/elements/select_lists.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@ does_this_allow_multiple_selections = select_object.multiple?
305305
{{< tab header="Kotlin" >}}
306306
val doesThisAllowMultipleSelections = selectObject.isMultiple
307307
{{< /tab >}}
308-
{{< /tabpane >}}
308+
{{< /tabpane >}}

0 commit comments

Comments
 (0)