Selenium Nodes for KNIME: Extension Development Guide
These examples show how developers can use the Selenium Nodes’ extension points to add new functionality.
As a showcase it provides a very rudimentary sample integration of Appium, “an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol.”
Please note, that this repository does not contain the source code of the Selenium Nodes, which is not open sourced.
The following extension points are currently provided by the Selenium Nodes:
ws.palladian.nodes.selenium.plugin.WebDriverFactory— Allows to register new
WebDriverimplementations which can be selected in the WebDriver Factory node.
ws.palladian.nodes.selenium.plugin.CapabilitySnippetSource— Allows to register JSON snippets for providing Selenium capabilities which can be selected in the WebDriver Factory node. Check the file
/plugin/resources/AppiumCapabilitySnippets.jsonfor the syntax.
ws.palladian.nodes.selenium.plugin.LocatorFactory— Allows to add additional locators for the Find Elements node. See
/plugin/src/com/seleniumnodes/devexamples/locators/ContainsTextLocatorFactory.javafor an example implementation.
Besides these, there’s also an example for a node implementation using KNIME’s
org.knime.workbench.repository.nodesextension point in
/plugin/src/com/seleniumnodes/devexamples/nodes. It makes use of the
ws.palladian.nodes.selenium.types.WebDriverValuedata value to interact with a mobile browser.
Development and build prerequisites
- Eclipse (preferably use Eclipse IDE for Java Developers)
- M2Eclipse (already included if you use the Eclipse IDE for Java Developers)
feature/— the feature definition
plugin/— the code for extensions
pom.xml— parent and aggregation
pom.xmlfor triggering the entire Tycho build
targetplatform/— the target platform definition for building and development
testflowrunner/— runs the test workflows; this requires to put an .epf file with a valid Selenium Nodes license in
update/— generates the update site for distribution
Setting up the development environment
Run the following command which downloads the required dependencies (Appium libraries and transitive dependencies) and puts them into
$ mvn clean initialize
In Eclipse, go to Import … → Existing Maven Projects, select the project’s root folder and import all subprojects. When you’re asked to install “m2e connectors”, do so. The projects will still show compile errors, as the dependencies cannot be resolved.
Set the target platform in Eclipse. Open the
.targetfile in the
targetplatformdirectory, wait until the progress bar for resolving the target platform has disappeared and click Set as Target Platform. After the progress has completed (takes some time depending on the internet connection), all compile errors should have disappeared.
Create a new launch configuration for an Eclipse Application and specify
org.knime.product.KNIME_PRODUCTunder Program to Run. Save, click Run and KNIME should start.
The following command builds the entire project, creates an update site, runs unit tests and test workflows using Tycho:
$ mvn clean verify
The generated P2 update site can be found in
Running test workflows
For running test workflows, a valid Selenium Nodes license needs to be present. It is supplied to the testflow run as an exported Eclipse preferences file. To create this file, export your preferences from the KNIME application through File → Export Preferences… and put it in
Selenium Nodes for KNIME were created by seleniumnodes.com, 2015 — 2018.