Skip to content

Commit a8dc33e

Browse files
authored
Merge branch 'trunk' into dependabot/bundler/examples/ruby/json-2.10.2
2 parents 8f01f14 + d105d95 commit a8dc33e

File tree

6 files changed

+273
-12
lines changed

6 files changed

+273
-12
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package dev.selenium.bidirectional.webdriver_bidi.user_context;
2+
3+
import org.junit.jupiter.api.AfterEach;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.BeforeEach;
6+
import org.junit.jupiter.api.Test;
7+
import org.openqa.selenium.By;
8+
import org.openqa.selenium.WebDriver;
9+
import org.openqa.selenium.WebElement;
10+
import org.openqa.selenium.firefox.FirefoxDriver;
11+
import org.openqa.selenium.firefox.FirefoxOptions;
12+
13+
class MultipleInstanceParallelTest {
14+
15+
private WebDriver driver;
16+
17+
@BeforeEach
18+
public void setup() {
19+
FirefoxOptions options = new FirefoxOptions();
20+
options.setCapability("webSocketUrl", true);
21+
options.addArguments("-private");
22+
driver = new FirefoxDriver(options);
23+
}
24+
25+
@Test
26+
void canSwitchToBlue() {
27+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
28+
29+
WebElement body = driver.findElement(By.tagName("body"));
30+
String bgColor = body.getCssValue("background-color");
31+
32+
String expectedColor = "rgb(255, 255, 255)";
33+
// Background color is white
34+
Assertions.assertEquals(bgColor, expectedColor);
35+
36+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
37+
38+
driver.findElement(By.id("blue-btn")).click();
39+
body = driver.findElement(By.tagName("body"));
40+
bgColor = body.getCssValue("background-color");
41+
42+
expectedColor = "rgb(173, 216, 230)";
43+
// Background color is blue
44+
Assertions.assertEquals(bgColor, expectedColor);
45+
46+
System.out.println(
47+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
48+
.getMethodName() + " => executed successfully");
49+
}
50+
51+
@Test
52+
void canSwitchToGreen() {
53+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
54+
55+
WebElement body = driver.findElement(By.tagName("body"));
56+
String bgColor = body.getCssValue("background-color");
57+
58+
String expectedColor = "rgb(255, 255, 255)";
59+
Assertions.assertEquals(bgColor, expectedColor);
60+
61+
driver.findElement(By.id("green-btn")).click();
62+
body = driver.findElement(By.tagName("body"));
63+
bgColor = body.getCssValue("background-color");
64+
65+
expectedColor = "rgb(144, 238, 144)";
66+
Assertions.assertEquals(bgColor, expectedColor);
67+
68+
System.out.println(
69+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
70+
.getMethodName() + " => executed successfully");
71+
}
72+
73+
@Test
74+
void canHaveTheDefaultBackgroundColor() {
75+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
76+
77+
WebElement body = driver.findElement(By.tagName("body"));
78+
String bgColor = body.getCssValue("background-color");
79+
80+
String expectedColor = "rgb(255, 255, 255)";
81+
Assertions.assertEquals(bgColor, expectedColor);
82+
83+
System.out.println(
84+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
85+
.getMethodName() + " => executed successfully");
86+
}
87+
88+
@AfterEach
89+
public void cleanup() {
90+
driver.quit();
91+
}
92+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
package dev.selenium.bidirectional.webdriver_bidi.user_context;
2+
3+
import org.junit.jupiter.api.AfterAll;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.BeforeAll;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.Test;
8+
import org.openqa.selenium.WebDriver;
9+
import org.openqa.selenium.WindowType;
10+
import org.openqa.selenium.bidi.browsingcontext.BrowsingContext;
11+
import org.openqa.selenium.bidi.browsingcontext.CreateContextParameters;
12+
import org.openqa.selenium.bidi.browsingcontext.Locator;
13+
import org.openqa.selenium.bidi.browsingcontext.ReadinessState;
14+
import org.openqa.selenium.bidi.module.Browser;
15+
import org.openqa.selenium.bidi.module.Input;
16+
import org.openqa.selenium.bidi.script.NodeProperties;
17+
import org.openqa.selenium.bidi.script.RemoteValue;
18+
import org.openqa.selenium.firefox.FirefoxDriver;
19+
import org.openqa.selenium.firefox.FirefoxOptions;
20+
import org.openqa.selenium.interactions.Actions;
21+
import org.openqa.selenium.remote.RemoteWebElement;
22+
23+
class SingleInstanceCookieParallelTest {
24+
25+
private static WebDriver driver;
26+
BrowsingContext context;
27+
28+
@BeforeAll
29+
public static void beforeAll() {
30+
FirefoxOptions options = new FirefoxOptions();
31+
options.setCapability("webSocketUrl", true);
32+
driver = new FirefoxDriver(options);
33+
34+
// To use Grid uncomment the lines below
35+
36+
// driver = new RemoteWebDriver(
37+
// new URL("http://localhost:4444"),
38+
// options, false);
39+
//
40+
// Augmenter augmenter = new Augmenter();
41+
// driver = augmenter.augment(driver);
42+
}
43+
44+
@BeforeEach
45+
public void setup() {
46+
Browser browser = new Browser(driver);
47+
String userContext = browser.createUserContext();
48+
49+
CreateContextParameters parameters = new CreateContextParameters(WindowType.TAB);
50+
parameters.userContext(userContext);
51+
52+
context = new BrowsingContext(driver, parameters);
53+
}
54+
55+
@Test
56+
void canSwitchToBlue() {
57+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
58+
59+
RemoteValue value = context.locateNode(Locator.xpath("/html/body/button[1]"));
60+
61+
Input inputModule = new Input(driver);
62+
Actions actions = new Actions(driver);
63+
64+
RemoteWebElement element = new RemoteWebElement();
65+
element.setId(value.getSharedId().get());
66+
actions.moveToElement(element).click();
67+
68+
inputModule.perform(context.getId(), actions.getSequences());
69+
70+
value = context.locateNode(Locator.xpath("/html/body"));
71+
72+
NodeProperties properties = (NodeProperties) value.getValue().get();
73+
String bgColor = properties.getAttributes().get().get("style");
74+
75+
Assertions.assertEquals(bgColor, "background-color: lightblue;");
76+
System.out.println(
77+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
78+
.getMethodName() + " => executed successfully");
79+
}
80+
81+
@Test
82+
void canSwitchToGreen() {
83+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
84+
85+
RemoteValue value = context.locateNode(Locator.xpath("/html/body"));
86+
87+
NodeProperties properties = (NodeProperties) value.getValue().get();
88+
String bgColor = properties.getAttributes().get().get("style");
89+
90+
Assertions.assertEquals(bgColor, "background-color: white;");
91+
92+
value = context.locateNode(Locator.xpath("/html/body/button[2]"));
93+
94+
Input inputModule = new Input(driver);
95+
Actions actions = new Actions(driver);
96+
97+
RemoteWebElement element = new RemoteWebElement();
98+
element.setId(value.getSharedId().get());
99+
actions.moveToElement(element).click();
100+
101+
inputModule.perform(context.getId(), actions.getSequences());
102+
103+
value = context.locateNode(Locator.xpath("/html/body"));
104+
105+
properties = (NodeProperties) value.getValue().get();
106+
bgColor = properties.getAttributes().get().get("style");
107+
108+
Assertions.assertEquals(bgColor, "background-color: lightgreen;");
109+
System.out.println(
110+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
111+
.getMethodName() + " => executed successfully");
112+
}
113+
114+
@Test
115+
void canHaveTheDefaultBackgroundColor() {
116+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
117+
118+
RemoteValue value = context.locateNode(Locator.xpath("/html/body"));
119+
120+
NodeProperties properties = (NodeProperties) value.getValue().get();
121+
String bgColor = properties.getAttributes().get().get("style");
122+
123+
Assertions.assertEquals(bgColor, "background-color: white;");
124+
System.out.println(
125+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
126+
.getMethodName() + " => executed successfully");
127+
}
128+
129+
@AfterAll
130+
public static void cleanup() {
131+
driver.quit();
132+
}
133+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Selenium Community Live - Episode 4"
3+
linkTitle: "Selenium Community Live - Episode 4"
4+
date: 2025-03-19
5+
tags: ["webinar", "meetup", "talks","community"]
6+
categories: ["webinar"]
7+
author: <a href="https://www.linkedin.com/in/pallavimuse/" target="_blank">Pallavi Sharma</a>
8+
images:
9+
description: >
10+
Selenium Community Live - Episode 4
11+
---
12+
13+
The fourth episode of Selenium Community Live happened on March 19th, 2025, with speaker **<a href="https://www.linkedin.com/in/mdmintz/" target="_blank">Michael Mintz</a>**, event hosted by **<a href="https://www.linkedin.com/in/pallavimuse/" target="_blank">Pallavi Sharma</a>**
14+
15+
You can watch the episode on YouTube here- **<a href="https://youtube.com/live/FSH712hhHvo?feature=share" target="_blank">Episode 4 on YouTube</a>**
16+
or
17+
You can watch the episode on LinkedIn here- **<a href="https://www.linkedin.com/events/seleniumcommunitylive-episode47301014781094678530/theater/" target="_blank">Episode 4 on LinkedIn</a>**
18+
19+
**Selenium Community Live - Episode 4**
20+
21+
Michael Mintz is creator of Selenium Base, an all in one Browser Automation Framework, built over Selenium WebDriver Python bindings. The framework is well known and used
22+
in the WebDriver Ecosystem community for testing, web scraping, web crawling and stealth purposes.
23+
You can find out more about Selenium Base here - **<a href="https://seleniumbase.io/" target="_blank">Selenium Base</a>**
24+
25+
26+
**Meet the Speakers:**
27+
28+
1. **<a href="https://www.linkedin.com/in/mdmintz/" target="_blank">Michael Mintz</a>**
29+
30+
31+
## Watch the Recording
32+
33+
Couldn’t join us live? Watch the entire episode here -
34+
📹 Recording Link: [Watch the Event Recording on YouTube](https://youtube.com/live/FSH712hhHvo?feature=share)
35+
36+
To know more about Selenium Base, please follow the link
37+
**<a href="https://seleniumbase.io/help_docs/thank_you/" target="_blank">Explore more on Selenium Base</a>**
38+
39+
In case you were wondering what happened to episode 3, it was cancelled but will be scheduled in coming weeks. Thank you!
40+
Stay tuned as we bring the next! **<a href="https://www.youtube.com/@SeleniumHQProject/streams" target="_blank">Subscribe here to the Selenium HQ Official YouTube Channel.</a>**

website_and_docs/layouts/downloads/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="card-body">
2626
<p class="card-text">
2727
Latest stable version
28-
<a href="https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.29.0/selenium-server-4.29.0.jar">4.29.0</a>
28+
<a href="https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.30.0/selenium-server-4.30.0.jar">4.30.0</a>
2929
</p>
3030
<p class="card-text">
3131
To use the Selenium Server in a Grid configuration see the

website_and_docs/layouts/partials/announcement-banner.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ <h4 class="alert-heading text-center m-2">
99
Registrations Open for SeleniumConf 2025 | March 26–28 | Join Us In-Person!
1010
<a href="https://seleniumconf.com/?utm_medium=Referral&utm_source=selenium.dev&utm_campaign=register" target='_blank' aria-pressed="true"> Register now!</a>
1111
</h4>
12-
<h4 class="alert-heading text-center m-4">
13-
Join us for the Selenium Community Live Episode on - 19th March 2025!
14-
<a href="https://www.linkedin.com/events/seleniumcommunitylive-episode47301014781094678530/theater/" target='_blank' aria-pressed="true">Read more</a>
15-
</h4>
1612
</div>
1713
</div>
1814
</div>

website_and_docs/layouts/partials/selenium-clients-and-webdriver-bindings.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
2727
<p class="card-text m-0 pb-1">
2828
Stable:
2929
<a href="https://www.nuget.org/packages/Selenium.WebDriver" class="card-link">
30-
4.29.0 (February 20, 2025)
30+
4.30.0 (March 21, 2025)
3131
</a>
3232
</p>
3333
<p class="card-text m-0 pb-1">
@@ -54,8 +54,8 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
5454
</p>
5555
<p class="card-text m-0 pb-1">
5656
Stable:
57-
<a href="https://rubygems.org/gems/selenium-webdriver/versions/4.29.0" class="card-link">
58-
4.29.0 (February 20, 2025)
57+
<a href="https://rubygems.org/gems/selenium-webdriver/versions/4.30.1" class="card-link">
58+
4.30.1 (March 22, 2025)
5959
</a>
6060
</p>
6161
<p class="card-text m-0 pb-1">
@@ -82,8 +82,8 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
8282
</p>
8383
<p class="card-text m-0 pb-1">
8484
Stable:
85-
<a href="https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.29.0/selenium-java-4.29.0.zip" class="card-link">
86-
4.29.0 (February 20, 2025)
85+
<a href="https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.30.0/selenium-java-4.30.0.zip" class="card-link">
86+
4.30.0 (March 21, 2025)
8787
</a>
8888
</p>
8989
<p class="card-text m-0 pb-1">
@@ -111,7 +111,7 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
111111
<p class="card-text m-0 pb-1">
112112
Stable:
113113
<a href="https://pypi.python.org/pypi/selenium" class="card-link">
114-
4.29.0 (February 20, 2024)
114+
4.30.0 (March 21, 2024)
115115
</a>
116116
</p>
117117
<p class="card-text m-0 pb-1">
@@ -139,7 +139,7 @@ <h2 id="bindings" class="card-title">Selenium Clients and WebDriver Language Bin
139139
<p class="card-text m-0 pb-1">
140140
Stable:
141141
<a href="https://npmjs.org/package/selenium-webdriver" class="card-link">
142-
4.29.0 (February 20, 2025)
142+
4.30.0 (March 21, 2025)
143143
</a>
144144
</p>
145145
<p class="card-text m-0 pb-1">

0 commit comments

Comments
 (0)