Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.openqa.selenium.support.ui.Select;
from selenium.webdriver.support.select import Select
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
using OpenQA.Selenium.Support.UI
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
include Selenium::WebDriver::Support
Expand All @@ -48,7 +48,8 @@ select_element = driver.find_element_by_id('selectElementID')
select_object = Select(select_element)
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
IWebElement selectElement = driver.FindElement(By.Id("selectElementID"));
var selectObject = new SelectElement(selectElement);
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
select_element = driver.find_element(id: 'selectElementID')
Expand Down Expand Up @@ -100,7 +101,14 @@ select_object.select_by_value('value1')
select_object.select_by_visible_text('Bread')
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
// Select an <option> based upon the <select> element's internal index
selectObject.SelectByIndex(1);

// Select an <option> based upon its value attribute
selectObject.SelectByValue("value1");

// Select an <option> based upon its text
selectObject.SelectByText("Bread");
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
# Select an <option> based upon the <select> element's internal index
Expand Down Expand Up @@ -180,7 +188,8 @@ List<WebElement> allAvailableOptions = selectObject.getOptions();
all_available_options = select_object.options
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
// Return a IList<IWebElement> of options that the <select> element contains
IList<IWebElement> allAvailableOptions = selectObject.Options;
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
# Return an Array[Element] of options that the &lt;select&gt; element contains
Expand Down Expand Up @@ -225,7 +234,17 @@ select_object.deselect_by_visible_text('Bread')
select_object.deselect_all()
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
// Deselect an <option> based upon the <select> element's internal index
selectObject.DeselectByIndex(1);

// Deselect an <option> based upon its value attribute
selectObject.DeselectByValue("value1");

// Deselect an <option> based upon its text
selectObject.DeselectByText("Bread");

// Deselect all selected <option> elements
selectObject.DeselectAll();
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
# Deselect an <option> based upon the <select> element's internal index
Expand Down Expand Up @@ -269,7 +288,7 @@ Boolean doesThisAllowMultipleSelections = selectObject.isMultiple();
does_this_allow_multiple_selections = select_object.is_multiple
{{< / code-panel >}}
{{< code-panel language="csharp" >}}
// We don't have a C# code sample yet - Help us out and raise a PR
bool doesThisAllowMultipleSelections = selectObject.IsMultiple;
{{< / code-panel >}}
{{< code-panel language="ruby" >}}
does_this_allow_multiple_selections = select_object.multiple?
Expand All @@ -280,4 +299,4 @@ does_this_allow_multiple_selections = select_object.multiple?
{{< code-panel language="kotlin" >}}
val doesThisAllowMultipleSelections = selectObject.isMultiple
{{< / code-panel >}}
{{< / code-tab >}}
{{< / code-tab >}}