diff --git a/NodeBase/generate_config b/NodeBase/generate_config index 6e8d75b21c..49bf5ff91f 100755 --- a/NodeBase/generate_config +++ b/NodeBase/generate_config @@ -59,7 +59,12 @@ elif [[ "${SE_NODE_BROWSER_NAME}" == "MicrosoftEdge" ]]; then SE_NODE_BROWSER_VERSION=$(short_version $(microsoft-edge --version | awk '{print $3}')) fi +if [[ -z "$SE_NODE_STEREOTYPE" ]]; then SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\"}" +else +SE_NODE_STEREOTYPE="$SE_NODE_STEREOTYPE" +fi + echo "[[node.driver-configuration]]" >> "$FILENAME" echo "display-name = \"${SE_NODE_BROWSER_NAME}\"" >> "$FILENAME" echo "stereotype = '${SE_NODE_STEREOTYPE}'" >> "$FILENAME" diff --git a/README.md b/README.md index b6658e2123..7ec35cb606 100644 --- a/README.md +++ b/README.md @@ -779,11 +779,16 @@ In both cases, it is necessary to tell the Node where the Event Bus is, so it ca the purpose of the `SE_EVENT_BUS_HOST`, `SE_EVENT_BUS_PUBLISH_PORT` and `SE_EVENT_BUS_SUBSCRIBE_PORT` environment variables. -Here is an example with the default values of these environment variables: +In some cases, for example if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environement variable `SE_NODE_STEREOTYPE` +sets the stereotype entry in the node's `config.toml`. An example config.toml file can be found here: [Setting custom capabilities for matching specific Nodes](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes). +Here is an example with the default values of these environment variables: ```bash -$ docker run -d -e SE_EVENT_BUS_HOST= -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 --shm-size="2g" selenium/node-chrome:4.4.0-20220812 +$ docker run -d \ + -e SE_EVENT_BUS_HOST= \ + -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ + --shm-size="2g" selenium/node-chrome:4.4.0-20220812 ``` ### Setting Screen Resolution