Skip to content

Commit dc43632

Browse files
committed
Appending Grid url to different roles
1 parent 7609239 commit dc43632

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

NodeDocker/start-selenium-grid-node-docker.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ if [ ! -z "$SE_OPTS" ]; then
2424
echo "Appending Selenium options: ${SE_OPTS}"
2525
fi
2626

27+
if [ ! -z "$SE_NODE_GRID_URL" ]; then
28+
echo "Appending Grid url: ${SE_NODE_GRID_URL}"
29+
SE_GRID_URL="--grid-url ${SE_NODE_GRID_URL}"
30+
fi
31+
2732
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server.jar node \
2833
--publish-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_PUBLISH_PORT} \
2934
--subscribe-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_SUBSCRIBE_PORT} \
3035
--detect-drivers false \
3136
--config /opt/bin/config.toml \
32-
${SE_OPTS}
37+
${SE_GRID_URL} ${SE_OPTS}

Standalone/generate_config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ relax-checks = ${SE_RELAX_CHECKS}
1111
" > /opt/selenium/config.toml
1212

1313
echo "[node]" >> /opt/selenium/config.toml
14+
# String, Url where the Grid can be reached
15+
if [[ -z "${SE_NODE_GRID_URL}" ]]; then
16+
echo "Setting up SE_NODE_GRID_URL..."
17+
else
18+
echo "grid-url = \"${SE_NODE_GRID_URL}\"" >> /opt/selenium/config.toml
19+
fi
1420
echo "session-timeout = \"${SE_NODE_SESSION_TIMEOUT}\"" >> /opt/selenium/config.toml
1521
echo "override-max-sessions = ${SE_NODE_OVERRIDE_MAX_SESSIONS}" >> /opt/selenium/config.toml
1622
echo "detect-drivers = false" >> /opt/selenium/config.toml

StandaloneDocker/start-selenium-grid-standalone-docker.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ if [ ! -z "$SE_OPTS" ]; then
99
echo "Appending Selenium options: ${SE_OPTS}"
1010
fi
1111

12+
if [ ! -z "$SE_NODE_GRID_URL" ]; then
13+
echo "Appending Grid url: ${SE_NODE_GRID_URL}"
14+
SE_GRID_URL="--grid-url ${SE_NODE_GRID_URL}"
15+
fi
16+
1217
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server.jar standalone \
1318
--relax-checks ${SE_RELAX_CHECKS} \
1419
--detect-drivers false \
1520
--config /opt/bin/config.toml \
16-
${SE_OPTS}
21+
${SE_GRID_URL} ${SE_OPTS}

0 commit comments

Comments
 (0)