Skip to content

Commit f6b1b99

Browse files
authored
Merge branch 'trunk' into java-alert-examples
2 parents a63d616 + d501255 commit f6b1b99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+379
-202
lines changed

Diff for: .github/workflows/java-examples.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
command: |
6868
pip install yq
6969
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
70-
latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r .text)
71-
echo $latest_snapshot
70+
latest_snapshot=$(echo "$xml_content" | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | last | .text')
71+
echo "Latest Selenium Snapshot: $latest_snapshot"
7272
cd examples/java
7373
mvn -B -U test -Dselenium.version="$latest_snapshot"
7474
@@ -81,7 +81,7 @@ jobs:
8181
command: |
8282
pip install yq
8383
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
84-
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r .text
85-
Write-Output $latest_snapshot
84+
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | last | .text'
85+
Write-Output "Latest Selenium Snapshot: $latest_snapshot"
8686
cd examples/java
8787
mvn -B -U test "-Dselenium.version=$latest_snapshot"

Diff for: examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
1111
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
1212
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
13-
<PackageReference Include="Selenium.Support" Version="4.23.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.24.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.24.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

Diff for: examples/java/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.23.1'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.24.0'
1414
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
1515
}
1616

Diff for: examples/java/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>11</maven.compiler.source>
1414
<maven.compiler.target>11</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.23.1</selenium.version>
16+
<selenium.version>4.24.0</selenium.version>
1717
</properties>
1818

1919
<repositories>
@@ -55,7 +55,7 @@
5555
<plugin>
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-surefire-plugin</artifactId>
58-
<version>3.4.0</version>
58+
<version>3.5.0</version>
5959
<configuration>
6060
<properties>
6161
<configurationParameters>

Diff for: examples/java/src/test/java/dev/selenium/bidi/cdp/CdpApiTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import org.openqa.selenium.chrome.ChromeOptions;
1717
import org.openqa.selenium.devtools.DevTools;
1818
import org.openqa.selenium.devtools.HasDevTools;
19-
import org.openqa.selenium.devtools.v125.browser.Browser;
20-
import org.openqa.selenium.devtools.v125.network.Network;
21-
import org.openqa.selenium.devtools.v125.network.model.Headers;
19+
import org.openqa.selenium.devtools.v128.browser.Browser;
20+
import org.openqa.selenium.devtools.v128.network.Network;
21+
import org.openqa.selenium.devtools.v128.network.model.Headers;
2222
import org.openqa.selenium.support.ui.WebDriverWait;
2323

2424
public class CdpApiTest extends BaseTest {
@@ -27,7 +27,7 @@ public class CdpApiTest extends BaseTest {
2727
@BeforeEach
2828
public void createSession() {
2929
ChromeOptions options = new ChromeOptions();
30-
options.setBrowserVersion("125");
30+
options.setBrowserVersion("128");
3131
driver = new ChromeDriver(options);
3232
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
3333
}

Diff for: examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
import org.openqa.selenium.devtools.DevTools;
2222
import org.openqa.selenium.devtools.HasDevTools;
2323
import org.openqa.selenium.devtools.NetworkInterceptor;
24-
import org.openqa.selenium.devtools.v125.browser.Browser;
25-
import org.openqa.selenium.devtools.v125.network.Network;
26-
import org.openqa.selenium.devtools.v125.performance.Performance;
27-
import org.openqa.selenium.devtools.v125.performance.model.Metric;
24+
import org.openqa.selenium.devtools.v128.browser.Browser;
25+
import org.openqa.selenium.devtools.v128.network.Network;
26+
import org.openqa.selenium.devtools.v128.performance.Performance;
27+
import org.openqa.selenium.devtools.v128.performance.model.Metric;
2828
import org.openqa.selenium.remote.http.*;
2929
import org.openqa.selenium.support.ui.WebDriverWait;
3030

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,74 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
package dev.selenium.interactions;
219

3-
import dev.selenium.BaseTest;
20+
import org.junit.jupiter.api.Test;
21+
import org.openqa.selenium.*;
22+
import org.openqa.selenium.chrome.ChromeDriver;
23+
import java.time.Duration;
24+
import static org.junit.jupiter.api.Assertions.assertEquals;
25+
26+
public class FramesTest{
427

5-
public class FramesTest extends BaseTest {
28+
@Test
29+
public void informationWithElements() {
30+
31+
WebDriver driver = new ChromeDriver();
32+
driver.manage().timeouts().implicitlyWait(Duration.ofMillis(500));
33+
34+
// Navigate to Url
35+
driver.get("https://www.selenium.dev/selenium/web/iframes.html");
36+
37+
38+
//switch To IFrame using Web Element
39+
WebElement iframe = driver.findElement(By.id("iframe1"));
40+
//Switch to the frame
41+
driver.switchTo().frame(iframe);
42+
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
43+
//Now we can type text into email field
44+
WebElement emailE= driver.findElement(By.id("email"));
45+
emailE.sendKeys("[email protected]");
46+
emailE.clear();
47+
driver.switchTo().defaultContent();
48+
49+
50+
//switch To IFrame using name or id
51+
driver.findElement(By.name("iframe1-name"));
52+
//Switch to the frame
53+
driver.switchTo().frame(iframe);
54+
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
55+
WebElement email=driver.findElement(By.id("email"));
56+
//Now we can type text into email field
57+
email.sendKeys("[email protected]");
58+
email.clear();
59+
driver.switchTo().defaultContent();
60+
61+
62+
//switch To IFrame using index
63+
driver.switchTo().frame(0);
64+
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
65+
66+
//leave frame
67+
driver.switchTo().defaultContent();
68+
assertEquals(true, driver.getPageSource().contains("This page has iframes"));
69+
70+
//quit the browser
71+
driver.quit();
72+
}
673

7-
}
74+
}

Diff for: examples/javascript/package-lock.json

+15-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: examples/javascript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "Apache-2.0",
99
"dependencies": {
1010
"assert": "2.1.0",
11-
"selenium-webdriver": "4.23.0"
11+
"selenium-webdriver": "4.24.0"
1212
},
1313
"devDependencies": {
1414
"mocha": "10.7.3"

Diff for: examples/kotlin/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
<junit5.version>5.11.0</junit5.version>
1818
<wdm.version>5.2.3</wdm.version>
1919

20-
<maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version>
20+
<maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>
2121

2222
<java.version>1.8</java.version>
23-
<selenium.version>4.23.1</selenium.version>
23+
<selenium.version>4.24.0</selenium.version>
2424

2525
<maven.compiler.target>${java.version}</maven.compiler.target>
2626
<maven.compiler.source>${java.version}</maven.compiler.source>

Diff for: examples/python/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
selenium==4.23.1
1+
selenium==4.24.0
22
pytest
33
trio
44
pytest-trio

Diff for: examples/python/tests/bidi/cdp/test_network.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44
from selenium.webdriver.common.by import By
5-
from selenium.webdriver.common.devtools.v125.network import Headers
5+
from selenium.webdriver.common.devtools.v128.network import Headers
66

77

88
@pytest.mark.trio

Diff for: examples/ruby/Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ gem 'rake', '~> 13.0'
77
gem 'rspec', '~> 3.0'
88
gem 'rubocop', '~> 1.35'
99
gem 'rubocop-rspec', '~> 3.0'
10-
gem 'selenium-devtools', '= 0.127.0'
11-
gem 'selenium-webdriver', '= 4.23.0'
10+
gem 'selenium-devtools', '= 0.128.0'
11+
gem 'selenium-webdriver', '= 4.24.0'

Diff for: examples/ruby/Gemfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GEM
1515
rainbow (3.1.1)
1616
rake (13.2.1)
1717
regexp_parser (2.9.2)
18-
rexml (3.3.4)
18+
rexml (3.3.6)
1919
strscan
2020
rspec (3.13.0)
2121
rspec-core (~> 3.13.0)
@@ -47,9 +47,9 @@ GEM
4747
rubocop (~> 1.61)
4848
ruby-progressbar (1.13.0)
4949
rubyzip (2.3.2)
50-
selenium-devtools (0.127.0)
50+
selenium-devtools (0.128.0)
5151
selenium-webdriver (~> 4.2)
52-
selenium-webdriver (4.23.0)
52+
selenium-webdriver (4.24.0)
5353
base64 (~> 0.2)
5454
logger (~> 1.4)
5555
rexml (~> 3.2, >= 3.2.5)
@@ -73,8 +73,8 @@ DEPENDENCIES
7373
rspec (~> 3.0)
7474
rubocop (~> 1.35)
7575
rubocop-rspec (~> 3.0)
76-
selenium-devtools (= 0.127.0)
77-
selenium-webdriver (= 4.23.0)
76+
selenium-devtools (= 0.128.0)
77+
selenium-webdriver (= 4.24.0)
7878

7979
BUNDLED WITH
8080
2.5.6

0 commit comments

Comments
 (0)