From 366dc11be99712eb28f9df4c5ca601e3a5418740 Mon Sep 17 00:00:00 2001 From: Krishnan Mahadevan Date: Thu, 10 Nov 2022 10:40:38 +0530 Subject: [PATCH 1/4] Customize a node docs enhancement * Added details on how node types * Made some formatting changes to the docs. --- .../advanced_features/customize_node.en.md | 58 +++++++++++++++--- .../advanced_features/customize_node.ja.md | 58 +++++++++++++++--- .../advanced_features/customize_node.pt-br.md | 61 ++++++++++++++++--- .../advanced_features/customize_node.zh-cn.md | 58 +++++++++++++++--- 4 files changed, 202 insertions(+), 33 deletions(-) diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md index 141b1842bb9f..c1ea6dbc46a6 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md @@ -9,7 +9,7 @@ aliases: [ --- -### How to customize a Node +## How to customize a Node There are times when we would like a Node to be customized to our needs. @@ -29,20 +29,40 @@ Following steps can be followed for this: Let's see an example of all this: +### Custom Node as an uber jar + 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). 2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) - * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) + * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) +3. Add your customized Node to the project. +4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. +5. Now start the Node using the command: + +```bash +java -jar custom_node-server.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode +``` +**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +### Custom Node as a regular jar + +1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). +2. Add the below dependencies to your sample project. + * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. -4. Build an [uber jar](https://imagej.net/develop/uber-jars) if you would like to just use `java -jar` to start the Node. +4. Build a jar of your project using your build tool. 5. Now start the Node using the command: ```bash -java -jar custom_node-1.0-SNAPSHOT.jar node \ ---node-implementation org.seleniumhq.samples.CommentatingNode +java -jar selenium-server-4.6.0.jar \ +--ext custom_node-1.0-SNAPSHOT.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` +**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. -Here's a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. +Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node.
@@ -88,7 +108,10 @@ public class DecoratedLoggingNode extends Node { BaseServerOptions serverOptions = new BaseServerOptions(config); URI uri = serverOptions.getExternalUri(); SecretOptions secretOptions = new SecretOptions(config); + + // Refer to the foot notes for additional context on this line. Node node = LocalNodeFactory.create(config); + DecoratedLoggingNode wrapper = new DecoratedLoggingNode(loggingOptions.getTracer(), uri, secretOptions.getRegistrationSecret()); wrapper.node = node; @@ -208,4 +231,23 @@ public class DecoratedLoggingNode extends Node { } } ``` -
\ No newline at end of file + + +**_Foot Notes:_** + +In the above example, the line `Node node = LocalNodeFactory.create(config);` explicitly creates a `LocalNode`. + +There are basically 2 types of *user facing implementations* of `org.openqa.selenium.grid.node.Node` available. + +These classes are good starting points to learn how to build a custom Node and also to learn the internals of a Node. + +* `org.openqa.selenium.grid.node.local.LocalNode` - Used to represent a long running Node and is the default implementation that gets wired in when you start a `node`. + * It can be created by calling `LocalNodeFactory.create(config);`, where: + * `LocalNodeFactory` belongs to `org.openqa.selenium.grid.node.local` + * `Config` belongs to `org.openqa.selenium.grid.config` +* `org.openqa.selenium.grid.node.k8s.OneShotNode` - This is a special reference implementation wherein the Node gracefully shuts itself down after servicing one test session. This class is currently not available as part of any pre-built maven artifact. + * You can refer to the source code [here](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) to understand its internals. + * To build it locally refer [here](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md). + * It can be created by calling `OneShotNode.create(config)`, where: + * `OneShotNode` belongs to `org.openqa.selenium.grid.node.k8s` + * `Config` belongs to `org.openqa.selenium.grid.config` diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md index 9995bca7d000..0790af31b9ea 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md @@ -17,7 +17,7 @@ aliases: [

{{% /pageinfo %}} -### How to customize a Node +## How to customize a Node There are times when we would like a Node to be customized to our needs. @@ -37,20 +37,40 @@ Following steps can be followed for this: Let's see an example of all this: +### Custom Node as an uber jar + 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). 2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) - * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) + * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) +3. Add your customized Node to the project. +4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. +5. Now start the Node using the command: + +```bash +java -jar custom_node-server.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode +``` +**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +### Custom Node as a regular jar + +1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). +2. Add the below dependencies to your sample project. + * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. -4. Build an [uber jar](https://imagej.net/develop/uber-jars) if you would like to just use `java -jar` to start the Node. +4. Build a jar of your project using your build tool. 5. Now start the Node using the command: ```bash -java -jar custom_node-1.0-SNAPSHOT.jar node \ ---node-implementation org.seleniumhq.samples.CommentatingNode +java -jar selenium-server-4.6.0.jar \ +--ext custom_node-1.0-SNAPSHOT.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` +**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. -Here's a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. +Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node.
@@ -96,7 +116,10 @@ public class DecoratedLoggingNode extends Node { BaseServerOptions serverOptions = new BaseServerOptions(config); URI uri = serverOptions.getExternalUri(); SecretOptions secretOptions = new SecretOptions(config); + + // Refer to the foot notes for additional context on this line. Node node = LocalNodeFactory.create(config); + DecoratedLoggingNode wrapper = new DecoratedLoggingNode(loggingOptions.getTracer(), uri, secretOptions.getRegistrationSecret()); wrapper.node = node; @@ -216,4 +239,23 @@ public class DecoratedLoggingNode extends Node { } } ``` -
\ No newline at end of file + + +**_Foot Notes:_** + +In the above example, the line `Node node = LocalNodeFactory.create(config);` explicitly creates a `LocalNode`. + +There are basically 2 types of *user facing implementations* of `org.openqa.selenium.grid.node.Node` available. + +These classes are good starting points to learn how to build a custom Node and also to learn the internals of a Node. + +* `org.openqa.selenium.grid.node.local.LocalNode` - Used to represent a long running Node and is the default implementation that gets wired in when you start a `node`. + * It can be created by calling `LocalNodeFactory.create(config);`, where: + * `LocalNodeFactory` belongs to `org.openqa.selenium.grid.node.local` + * `Config` belongs to `org.openqa.selenium.grid.config` +* `org.openqa.selenium.grid.node.k8s.OneShotNode` - This is a special reference implementation wherein the Node gracefully shuts itself down after servicing one test session. This class is currently not available as part of any pre-built maven artifact. + * You can refer to the source code [here](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) to understand its internals. + * To build it locally refer [here](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md). + * It can be created by calling `OneShotNode.create(config)`, where: + * `OneShotNode` belongs to `org.openqa.selenium.grid.node.k8s` + * `Config` belongs to `org.openqa.selenium.grid.config` diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md index ec1199b205b4..dd3c3732a9fa 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md @@ -17,7 +17,7 @@ aliases: [

{{% /pageinfo %}} -### How to customize a Node +## How to customize a Node There are times when we would like a Node to be customized to our needs. @@ -37,23 +37,44 @@ Following steps can be followed for this: Let's see an example of all this: +### Custom Node as an uber jar + 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). 2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) - * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) + * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. -4. Build an [uber jar](https://imagej.net/develop/uber-jars) if you would like to just use `java -jar` to start the Node. +4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. 5. Now start the Node using the command: ```bash -java -jar custom_node-1.0-SNAPSHOT.jar node \ ---node-implementation org.seleniumhq.samples.CommentatingNode +java -jar custom_node-server.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` +**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +### Custom Node as a regular jar + +1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). +2. Add the below dependencies to your sample project. + * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) +3. Add your customized Node to the project. +4. Build a jar of your project using your build tool. +5. Now start the Node using the command: + +```bash +java -jar selenium-server-4.6.0.jar \ +--ext custom_node-1.0-SNAPSHOT.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode +``` +**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. + +Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. -Here's a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. -Sample customized node
+Sample customized node ```java package org.seleniumhq.samples; @@ -95,7 +116,10 @@ public class DecoratedLoggingNode extends Node { BaseServerOptions serverOptions = new BaseServerOptions(config); URI uri = serverOptions.getExternalUri(); SecretOptions secretOptions = new SecretOptions(config); + + // Refer to the foot notes for additional context on this line. Node node = LocalNodeFactory.create(config); + DecoratedLoggingNode wrapper = new DecoratedLoggingNode(loggingOptions.getTracer(), uri, secretOptions.getRegistrationSecret()); wrapper.node = node; @@ -215,4 +239,23 @@ public class DecoratedLoggingNode extends Node { } } ``` -
\ No newline at end of file + + +**_Foot Notes:_** + +In the above example, the line `Node node = LocalNodeFactory.create(config);` explicitly creates a `LocalNode`. + +There are basically 2 types of *user facing implementations* of `org.openqa.selenium.grid.node.Node` available. + +These classes are good starting points to learn how to build a custom Node and also to learn the internals of a Node. + +* `org.openqa.selenium.grid.node.local.LocalNode` - Used to represent a long running Node and is the default implementation that gets wired in when you start a `node`. + * It can be created by calling `LocalNodeFactory.create(config);`, where: + * `LocalNodeFactory` belongs to `org.openqa.selenium.grid.node.local` + * `Config` belongs to `org.openqa.selenium.grid.config` +* `org.openqa.selenium.grid.node.k8s.OneShotNode` - This is a special reference implementation wherein the Node gracefully shuts itself down after servicing one test session. This class is currently not available as part of any pre-built maven artifact. + * You can refer to the source code [here](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) to understand its internals. + * To build it locally refer [here](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md). + * It can be created by calling `OneShotNode.create(config)`, where: + * `OneShotNode` belongs to `org.openqa.selenium.grid.node.k8s` + * `Config` belongs to `org.openqa.selenium.grid.config` diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md index 8501290d2c1c..56f1a2dca047 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md @@ -17,7 +17,7 @@ aliases: [

{{% /pageinfo %}} -### How to customize a Node +## How to customize a Node There are times when we would like a Node to be customized to our needs. @@ -37,20 +37,40 @@ Following steps can be followed for this: Let's see an example of all this: +### Custom Node as an uber jar + 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). 2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) - * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) + * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) +3. Add your customized Node to the project. +4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. +5. Now start the Node using the command: + +```bash +java -jar custom_node-server.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode +``` +**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +### Custom Node as a regular jar + +1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). +2. Add the below dependencies to your sample project. + * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) + * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. -4. Build an [uber jar](https://imagej.net/develop/uber-jars) if you would like to just use `java -jar` to start the Node. +4. Build a jar of your project using your build tool. 5. Now start the Node using the command: ```bash -java -jar custom_node-1.0-SNAPSHOT.jar node \ ---node-implementation org.seleniumhq.samples.CommentatingNode +java -jar selenium-server-4.6.0.jar \ +--ext custom_node-1.0-SNAPSHOT.jar node \ +--node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` +**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. -Here's a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. +Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node.
@@ -96,7 +116,10 @@ public class DecoratedLoggingNode extends Node { BaseServerOptions serverOptions = new BaseServerOptions(config); URI uri = serverOptions.getExternalUri(); SecretOptions secretOptions = new SecretOptions(config); + + // Refer to the foot notes for additional context on this line. Node node = LocalNodeFactory.create(config); + DecoratedLoggingNode wrapper = new DecoratedLoggingNode(loggingOptions.getTracer(), uri, secretOptions.getRegistrationSecret()); wrapper.node = node; @@ -216,4 +239,23 @@ public class DecoratedLoggingNode extends Node { } } ``` -
\ No newline at end of file + + +**_Foot Notes:_** + +In the above example, the line `Node node = LocalNodeFactory.create(config);` explicitly creates a `LocalNode`. + +There are basically 2 types of *user facing implementations* of `org.openqa.selenium.grid.node.Node` available. + +These classes are good starting points to learn how to build a custom Node and also to learn the internals of a Node. + +* `org.openqa.selenium.grid.node.local.LocalNode` - Used to represent a long running Node and is the default implementation that gets wired in when you start a `node`. + * It can be created by calling `LocalNodeFactory.create(config);`, where: + * `LocalNodeFactory` belongs to `org.openqa.selenium.grid.node.local` + * `Config` belongs to `org.openqa.selenium.grid.config` +* `org.openqa.selenium.grid.node.k8s.OneShotNode` - This is a special reference implementation wherein the Node gracefully shuts itself down after servicing one test session. This class is currently not available as part of any pre-built maven artifact. + * You can refer to the source code [here](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) to understand its internals. + * To build it locally refer [here](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md). + * It can be created by calling `OneShotNode.create(config)`, where: + * `OneShotNode` belongs to `org.openqa.selenium.grid.node.k8s` + * `Config` belongs to `org.openqa.selenium.grid.config` From b4dc69a00f8dfb40b06b0c40e33d4791e6b200f6 Mon Sep 17 00:00:00 2001 From: Krishnan Mahadevan Date: Thu, 10 Nov 2022 14:29:22 +0530 Subject: [PATCH 2/4] Removing the aliases --- .../documentation/grid/advanced_features/customize_node.en.md | 2 -- .../documentation/grid/advanced_features/customize_node.ja.md | 2 -- .../grid/advanced_features/customize_node.pt-br.md | 2 -- .../grid/advanced_features/customize_node.zh-cn.md | 2 -- 4 files changed, 8 deletions(-) diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md index c1ea6dbc46a6..431ac63fc59a 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md @@ -3,8 +3,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 aliases: [ -"/documentation/en/grid/grid_4/customize_node/", -"/documentation/grid/advanced_features/customize_node/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md index 0790af31b9ea..cdda7961fbf5 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md @@ -3,8 +3,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 aliases: [ -"/documentation/en/grid/grid_4/customize_node/", -"/documentation/grid/advanced_features/customize_node/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md index dd3c3732a9fa..6e7ee769f0eb 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md @@ -3,8 +3,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 aliases: [ -"/documentation/en/grid/grid_4/customize_node/", -"/documentation/grid/advanced_features/customize_node/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md index 56f1a2dca047..a805a3d599ed 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md @@ -3,8 +3,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 aliases: [ -"/documentation/en/grid/grid_4/customize_node/", -"/documentation/grid/advanced_features/customize_node/" ] --- From 805f29297561f5dc427318fa5aa98726cb5399f0 Mon Sep 17 00:00:00 2001 From: Krishnan Mahadevan Date: Thu, 10 Nov 2022 15:13:14 +0530 Subject: [PATCH 3/4] Fixing the dependencies information --- .../grid/advanced_features/customize_node.en.md | 11 ++++------- .../grid/advanced_features/customize_node.ja.md | 11 ++++------- .../grid/advanced_features/customize_node.pt-br.md | 11 ++++------- .../grid/advanced_features/customize_node.zh-cn.md | 11 ++++------- 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md index 431ac63fc59a..2cc6bc063f67 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md @@ -30,8 +30,7 @@ Let's see an example of all this: ### Custom Node as an uber jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. @@ -41,13 +40,13 @@ Let's see an example of all this: java -jar custom_node-server.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +**Note:** If you are using Maven as a build tool, please prefer using [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin) instead of [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin) because maven-assembly plugin seems to have issues with being able to merge multiple Service Provider Interface files (`META-INF/services`) ### Custom Node as a regular jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build a jar of your project using your build tool. @@ -58,8 +57,6 @@ java -jar selenium-server-4.6.0.jar \ --ext custom_node-1.0-SNAPSHOT.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. - Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md index cdda7961fbf5..57269a24e521 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md @@ -38,8 +38,7 @@ Let's see an example of all this: ### Custom Node as an uber jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. @@ -49,13 +48,13 @@ Let's see an example of all this: java -jar custom_node-server.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +**Note:** If you are using Maven as a build tool, please prefer using [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin) instead of [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin) because maven-assembly plugin seems to have issues with being able to merge multiple Service Provider Interface files (`META-INF/services`) ### Custom Node as a regular jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build a jar of your project using your build tool. @@ -66,8 +65,6 @@ java -jar selenium-server-4.6.0.jar \ --ext custom_node-1.0-SNAPSHOT.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. - Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md index 6e7ee769f0eb..6e33baf78860 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md @@ -38,8 +38,7 @@ Let's see an example of all this: ### Custom Node as an uber jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. @@ -49,13 +48,13 @@ Let's see an example of all this: java -jar custom_node-server.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +**Note:** If you are using Maven as a build tool, please prefer using [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin) instead of [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin) because maven-assembly plugin seems to have issues with being able to merge multiple Service Provider Interface files (`META-INF/services`) ### Custom Node as a regular jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build a jar of your project using your build tool. @@ -66,8 +65,6 @@ java -jar selenium-server-4.6.0.jar \ --ext custom_node-1.0-SNAPSHOT.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. - Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md index a805a3d599ed..4df52533e179 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md @@ -38,8 +38,7 @@ Let's see an example of all this: ### Custom Node as an uber jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below two dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command. @@ -49,13 +48,13 @@ Let's see an example of all this: java -jar custom_node-server.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** We need `selenium-java` as a dependency so that we can support all the common browser flavors via our uber jar execution. + +**Note:** If you are using Maven as a build tool, please prefer using [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin) instead of [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin) because maven-assembly plugin seems to have issues with being able to merge multiple Service Provider Interface files (`META-INF/services`) ### Custom Node as a regular jar 1. Create a sample project using your favourite build tool (**Maven**|**Gradle**). -2. Add the below dependencies to your sample project. - * [org.seleniumhq.selenium/selenium-remote-driver](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver) +2. Add the below dependency to your sample project. * [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid) 3. Add your customized Node to the project. 4. Build a jar of your project using your build tool. @@ -66,8 +65,6 @@ java -jar selenium-server-4.6.0.jar \ --ext custom_node-1.0-SNAPSHOT.jar node \ --node-implementation org.seleniumhq.samples.DecoratedLoggingNode ``` -**Note:** Here we are **NOT** using `selenium-java` as a dependency because its already part of the original selenium uber jar and we are just adding our custom node to the classpath via the `--ext` argument. - Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node. From 244d6333093af8bf31e211c97ec7905dd924d4ba Mon Sep 17 00:00:00 2001 From: Krishnan Mahadevan Date: Thu, 10 Nov 2022 16:43:36 +0530 Subject: [PATCH 4/4] Removed alias sections --- .../documentation/grid/advanced_features/customize_node.en.md | 2 -- .../documentation/grid/advanced_features/customize_node.ja.md | 2 -- .../grid/advanced_features/customize_node.pt-br.md | 2 -- .../grid/advanced_features/customize_node.zh-cn.md | 2 -- 4 files changed, 8 deletions(-) diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md index 2cc6bc063f67..59d98b9b4986 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.en.md @@ -2,8 +2,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 -aliases: [ -] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md index 57269a24e521..1eaaaa4c72a8 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.ja.md @@ -2,8 +2,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 -aliases: [ -] --- {{% pageinfo color="warning" %}} diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md index 6e33baf78860..51990d5f94ae 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.pt-br.md @@ -2,8 +2,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 -aliases: [ -] --- {{% pageinfo color="warning" %}} diff --git a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md index 4df52533e179..a357269e6cdf 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md @@ -2,8 +2,6 @@ title: "Customizing a Node" linkTitle: "Customize Node" weight: 4 -aliases: [ -] --- {{% pageinfo color="warning" %}}