Skip to content

Commit e9f1e35

Browse files
authored
Merge branch 'trunk' into update-python-drivers-docs
2 parents 25d9ae9 + e0439d1 commit e9f1e35

File tree

13 files changed

+166
-274
lines changed

13 files changed

+166
-274
lines changed

examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
using OpenQA.Selenium;
55
using OpenQA.Selenium.DevTools;
66
using System.Linq;
7-
using OpenQA.Selenium.DevTools.V126.Network;
8-
using OpenQA.Selenium.DevTools.V126.Performance;
7+
using OpenQA.Selenium.DevTools.V127.Network;
8+
using OpenQA.Selenium.DevTools.V127.Performance;
99

1010

1111
namespace SeleniumDocs.BiDi.CDP
@@ -16,7 +16,7 @@ public class NetworkTest : BaseTest
1616
[TestInitialize]
1717
public void Startup()
1818
{
19-
StartDriver("126");
19+
StartDriver("127");
2020
}
2121

2222
[TestMethod]
@@ -109,9 +109,9 @@ public async Task PerformanceMetrics()
109109
driver.Url = "https://www.selenium.dev/selenium/web/frameset.html";
110110

111111
var session = ((IDevTools)driver).GetDevToolsSession();
112-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V126.DevToolsSessionDomains>();
112+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
113113

114-
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V126.Performance.EnableCommandSettings());
114+
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V127.Performance.EnableCommandSettings());
115115
var metricsResponse =
116116
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
117117
new GetMetricsCommandSettings()
@@ -130,8 +130,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
130130
public async Task SetCookie()
131131
{
132132
var session = ((IDevTools)driver).GetDevToolsSession();
133-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V126.DevToolsSessionDomains>();
134-
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V126.Network.EnableCommandSettings());
133+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V127.DevToolsSessionDomains>();
134+
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V127.Network.EnableCommandSettings());
135135

136136
var cookieCommandSettings = new SetCookieCommandSettings
137137
{
Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,69 @@
1+
using System;
2+
using System.Drawing;
13
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
using OpenQA.Selenium;
5+
using OpenQA.Selenium.Chrome;
6+
27

38
namespace SeleniumDocs.Elements
49
{
510
[TestClass]
6-
public class InformationTest : BaseTest
11+
public class InformationTest
712
{
13+
[TestMethod]
14+
public void TestInformationCommands(){
15+
WebDriver driver = new ChromeDriver();
16+
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500);
17+
18+
// Navigate to Url
19+
driver.Url= "https://www.selenium.dev/selenium/web/inputs.html";
20+
// isDisplayed
21+
// Get boolean value for is element display
22+
bool isEmailVisible = driver.FindElement(By.Name("email_input")).Displayed;
23+
Assert.AreEqual(isEmailVisible, true);
24+
25+
//isEnabled
26+
//returns true if element is enabled else returns false
27+
bool isEnabledButton = driver.FindElement(By.Name("button_input")).Enabled;
28+
Assert.AreEqual(isEnabledButton, true);
29+
30+
//isSelected
31+
//returns true if element is checked else returns false
32+
bool isSelectedCheck = driver.FindElement(By.Name("checkbox_input")).Selected;
33+
Assert.AreEqual(isSelectedCheck, true);
34+
35+
//TagName
36+
//returns TagName of the element
37+
string tagNameInp = driver.FindElement(By.Name("email_input")).TagName;
38+
Assert.AreEqual(tagNameInp, "input");
39+
40+
//Get Location and Size
41+
//Get Location
42+
IWebElement rangeElement = driver.FindElement(By.Name("range_input"));
43+
Point point = rangeElement.Location;
44+
Assert.IsNotNull(point.X);
45+
//Get Size
46+
int height=rangeElement.Size.Height;
47+
Assert.IsNotNull(height);
48+
49+
// Retrieves the computed style property 'font-size' of field
50+
string cssValue = driver.FindElement(By.Name("color_input")).GetCssValue("font-size");
51+
Assert.AreEqual(cssValue, "13.3333px");
52+
53+
//GetText
54+
// Retrieves the text of the element
55+
string text = driver.FindElement(By.TagName("h1")).Text;
56+
Assert.AreEqual(text, "Testing Inputs");
57+
58+
//FetchAttributes
59+
//identify the email text box
60+
IWebElement emailTxt = driver.FindElement(By.Name("email_input"));
61+
//fetch the value property associated with the textbox
62+
string valueInfo = emailTxt.GetAttribute("value");
63+
Assert.AreEqual(valueInfo, "admin@localhost");
64+
65+
//Quit the driver
66+
driver.Quit();
67+
}
868
}
969
}

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ItemGroup>
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
12-
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
1313
<PackageReference Include="Selenium.Support" Version="4.23.0" />
1414
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
1515
</ItemGroup>
51 Bytes
Binary file not shown.

examples/java/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

examples/java/gradlew

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

examples/java/gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

examples/kotlin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<version>1.0.0</version>
1010

1111
<properties>
12-
<kotlin.version>2.0.0</kotlin.version>
12+
<kotlin.version>2.0.10</kotlin.version>
1313

14-
<slf4j.version>2.0.13</slf4j.version>
14+
<slf4j.version>2.0.14</slf4j.version>
1515
<logback.version>1.5.6</logback.version>
1616

1717
<junit5.version>5.10.3</junit5.version>

examples/ruby/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ GEM
4343
unicode-display_width (>= 2.4.0, < 3.0)
4444
rubocop-ast (1.31.3)
4545
parser (>= 3.3.1.0)
46-
rubocop-rspec (3.0.3)
46+
rubocop-rspec (3.0.4)
4747
rubocop (~> 1.61)
4848
ruby-progressbar (1.13.0)
4949
rubyzip (2.3.2)

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

Lines changed: 23 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
3737
is_email_visible = driver.find_element(By.NAME, "email_input").is_displayed()
3838
{{< /tab >}}
3939
{{< tab header="CSharp" >}}
40-
//Navigate to the url
41-
driver.Url = "https://www.selenium.dev/selenium/web/inputs.html";
42-
43-
//Get boolean value for is element display
44-
Boolean is_email_visible = driver.FindElement(By.Name("email_input")).Displayed;
40+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L18-L23" >}}
4541
{{< /tab >}}
4642
{{< tab header="Ruby" text=true >}}
4743
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L12">}}
@@ -79,16 +75,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
7975
# Returns true if element is enabled else returns false
8076
value = driver.find_element(By.NAME, 'button_input').is_enabled()
8177
{{< /tab >}}
82-
{{< tab header="CSharp" >}}
83-
// Navigate to Url
84-
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
85-
86-
// Store the WebElement
87-
IWebElement element = driver.FindElement(By.Name("button_input"));
88-
89-
// Prints true if element is enabled else returns false
90-
System.Console.WriteLine(element.Enabled);
91-
{{< /tab >}}
78+
{{< tab header="CSharp" >}}
79+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L25-L28" >}}
80+
{{< /tab >}}
9281
{{< tab header="Ruby" text=true >}}
9382
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L17">}}
9483
{{< /tab >}}
@@ -124,13 +113,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
124113
# Returns true if element is checked else returns false
125114
value = driver.find_element(By.NAME, "checkbox_input").is_selected()
126115
{{< /tab >}}
127-
{{< tab header="CSharp" >}}
128-
// Navigate to Url
129-
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
130-
131-
// Returns true if element ins checked else returns false
132-
bool value = driver.FindElement(By.Name("checkbox_input")).Selected;
133-
{{< /tab >}}
116+
{{< tab header="CSharp" >}}
117+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L30-L33" >}}
118+
{{< /tab >}}
134119
{{< tab header="Ruby" text=true >}}
135120
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L22">}}
136121
{{< /tab >}}
@@ -162,13 +147,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
162147
# Returns TagName of the element
163148
attr = driver.find_element(By.NAME, "email_input").tag_name
164149
{{< /tab >}}
165-
{{< tab header="CSharp" >}}
166-
// Navigate to Url
167-
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
168-
169-
// Returns TagName of the element
170-
string attr = driver.FindElement(By.Name("email_input")).TagName;
171-
{{< /tab >}}
150+
{{< tab header="CSharp" >}}
151+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L35-L38" >}}
152+
{{< /tab >}}
172153
{{< tab header="Ruby" text=true >}}
173154
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L27">}}
174155
{{< /tab >}}
@@ -206,16 +187,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
206187
# Returns height, width, x and y coordinates referenced element
207188
res = driver.find_element(By.NAME, "range_input").rect
208189
{{< /tab >}}
209-
{{< tab header="CSharp" >}}
210-
// Navigate to Url
211-
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
212-
213-
var res = driver.FindElement(By.Name("range_input"));
214-
// Return x and y coordinates referenced element
215-
System.Console.WriteLine(res.Location);
216-
// Returns height, width
217-
System.Console.WriteLine(res.Size);
218-
{{< /tab >}}
190+
{{< tab header="CSharp" >}}
191+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L40-L47" >}}
192+
{{< /tab >}}
219193
{{< tab header="Ruby" text=true >}}
220194
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L32">}}
221195
{{< /tab >}}
@@ -250,17 +224,10 @@ driver.get('https://www.selenium.dev/selenium/web/colorPage.html')
250224

251225
# Retrieves the computed style property 'color' of linktext
252226
cssValue = driver.find_element(By.ID, "namedColor").value_of_css_property('background-color')
253-
254-
{{< /tab >}}
255-
{{< tab header="CSharp" >}}
256-
257-
// Navigate to Url
258-
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/colorPage.html");
259-
260-
// Retrieves the computed style property 'color' of linktext
261-
String cssValue = driver.FindElement(By.Id("namedColor")).GetCssValue("background-color");
262-
263-
{{< /tab >}}
227+
{{< /tab >}}
228+
{{< tab header="CSharp" >}}
229+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L49-L51" >}}
230+
{{< /tab >}}
264231
{{< tab header="Ruby" text=true >}}
265232
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L38">}}
266233
{{< /tab >}}
@@ -293,13 +260,9 @@ driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
293260
# Retrieves the text of the element
294261
text = driver.find_element(By.ID, "justanotherlink").text
295262
{{< /tab >}}
296-
{{< tab header="CSharp" >}}
297-
// Navigate to url
298-
driver.Url="https://www.selenium.dev/selenium/web/linked_image.html";
299-
300-
// Retrieves the text of the element
301-
String text = driver.FindElement(By.Id("justanotherlink")).Text;
302-
{{< /tab >}}
263+
{{< tab header="CSharp" >}}
264+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L53-L56" >}}
265+
{{< /tab >}}
303266
{{< tab header="Ruby" text=true >}}
304267
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L43">}}
305268
{{< /tab >}}
@@ -337,16 +300,9 @@ email_txt = driver.find_element(By.NAME, "email_input")
337300
# Fetch the value property associated with the textbox
338301
value_info = email_txt.get_attribute("value")
339302
{{< /tab >}}
340-
{{< tab header="CSharp" >}}
341-
//Navigate to the url
342-
driver.Url="https://www.selenium.dev/selenium/web/inputs.html";
343-
344-
//identify the email text box
345-
IWebElement emailTxt = driver.FindElement(By.Name(("email_input")));
346-
347-
//fetch the value property associated with the textbox
348-
String valueInfo = eleSelLink.GetAttribute("value");
349-
{{< /tab >}}
303+
{{< tab header="CSharp" >}}
304+
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L58-L63" >}}
305+
{{< /tab >}}
350306
{{< tab header="Ruby" text=true >}}
351307
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L48">}}
352308
{{< /tab >}}

0 commit comments

Comments
 (0)