Node Documentation

This documentation is automatically generated with each new release of the Selenium Nodes and contains the description for each Selenium KNIME node. It is indentical to the node descriptions which are available directly within the KNIME application as well: Go to View → Node Description or click the button with the question mark in one of the nodes’ configuration dialogs.

Alert#

This node allows interacting with JavaScript-based alert, confirm, and prompt dialog boxes. When a WebBrowser shows a dialog, these can be dismissed or confirmed. Further, it allows to extract a dialog's text and send keyboard input to the dialog. The node assumes, that a dialog box is currently shown in the browser window.

Important: This node does not work with headless browsers (PhantomJS, jBrowser, HtmlUnit, headless Chrome). In case you want to influence the page's dialog behavior when running headless browsers, you can directly modify the window.alert, window.confirm, or window.prompt functions using an Execute JavaScript node, which needs to be placed at a point in the workflow, before the dialog is actually shown. The following code snippet gives a simple example how to globally override the default behavior:

window.alert = function() {
   // do nothing
}
window.confirm = function() {
  return true; // simulate, that all 'confirm' dialogs are closed via 'OK' button
}
window.prompt = function() {
  return 'dummy text'; // simulate, that the given string is entered into all 'prompt' dialogs
}
OptionDescription
WebDriver inputInput column which provides the WebDriver(s)
DismissClose the dialog by clicking the "Cancel" button.
AcceptClose the dialog by clicking the "OK" button.
Append column with textExtract the dialog's message and append it as text column.
Send keysThe text to send to the dialog (in case it is a "prompt" dialog).
PortsDescription
▸ 0Table with a column providing a WebDriver with an open alert, confirm, or prompt box.
0 ▸Same as input table, and appended text column in case the "Save text" option was selected.

Bulk RemoteWebDriver Factory#

Creates a factory loop for RemoteWebDrivers using different configurations.

OptionDescription
URLThe remote server URL
PortsDescription
▸ 0Table with the configuration rows for the WebDriver.
0 ▸A configured WebDriver factory.
1 ▸A table with the current row of the configuration input.

Clear#

Clears a WebElement in case it is a text entry element (input or textarea). In case the element is of different type, this node has no effect on the element. Note, that this does not fire any keyboard or mouse events. If you need this, use a Send Keys node instead, and send backspace keys to delete the element's content, then send a tab key to ensure that a change event is fired.

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
PortsDescription
▸ 0Table with a column providing WebElements to clear
0 ▸Same as input table

Click#

Clicks on a WebElement. In case the click causes a new page to load, the execution of this action will attempt block until the page has loaded (depending on various circumstances, it will not block, however). In this case, all existing WebElements referring to the previous page will become invalid, because the page is no longer available.

In case the click causes a new page to load via an event, the action will not block. In this case, you need to determine on your own, when the page has reloaded or simply wait for a fixed amount of time until you proceed with further execution.

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
PortsDescription
▸ 0Table with a column providing WebElements to click
0 ▸Same as input table

Drag and Drop#

Simulates drag and drop of a WebElement by a specified distance.

OptionDescription
X OffsetThe horizontal offset by which to drag the element.
Y OffsetThe vertical offset by which to drag the element.
PortsDescription
▸ 0Table with a column providing WebElements to drag and drop
0 ▸Same as input table

Execute JavaScript#

Executes JavaScript code in the current frame or window of the selected WebDriver. Data can be transferred between KNIME and the JavaScript code, by specifying a return type for the executed code and/or selecting input columns which provide argument values for the executed code.

Arguments can be accessed within JavaScript code through the arguments array. The following argument and return data types are supported:

JavaScriptKNIME
HTML elementWebElementValue
DecimalDoubleValue
Non-decimalLongValue
booleanBooleanValue
String and other casesStringValue

In case you need to execute code asynchronously, enable the [asyncCallbackMethod] argument. In this case, the last argument given to the executed code is the callback which signals that the code has finished execution. In case you need to return results from your asynchronous code, provide it as argument to the callback method. For example, the following JavaScript code causes the browser to sleep for five seconds, then the execution continues:

var callback = arguments[arguments.length - 1]; // last argument is callback
window.setTimeout(function() {
  console.log('finished');
  callback(); // invoke the callback to continue execution
}, 5000);

Timeouts for asynchronous execution can be configured in the Start WebDriver node in the "Timeouts" tab: Script timeout.

Tab, OptionDescription
Options
InputInput column which provides the WebDriver(s)
ArgumentsSelect columns from the input table or flow variables, which provide arguments for the executed code snippet. The selected entries are available in code in the listed order via the arguments array. Enable the last entry [asyncCallbackMethod] in case you're running an asynchronous script to be able to signal end of execution.
Return typeThe return type of the executed JavaScript code in order to map to an appropriate KNIME type, which will be appended as additional output column. Select "None", in case the code does not return any value.
Column nameThe name of the appended column with the result
JavaScript codeThe JavaScript code to execute
PortsDescription
▸ 0Table with a column providing a WebDriver
0 ▸Same as input table, optionally with an additional column with the return values of each JavaScript execution.

Execute Selenium script#

This node allows to execute Selenium 2 JSON scripts, which can e.g. be recorded using the Selenium Builder extension for Firefox. Using this extension, one can build Selenium workflows easily by interacting with the web browser.

By using variables within the Selenium script, data from KNIME can be fed to script and results can be given back to KNIME after the script execution:

  • In case, the selected script contains any variables which are not set by the script itself, the node expects the optional input table to be present and to provide columns with StringValues for each variable used within the script. The columns must have the same names as the variables within the script.
  • In case the script sets any variables during execution, their values are appended to the output table.
OptionDescription
File selectorSelect a Selenium 2 JSON script.
Close WebDriver after executionActivate to close the WebDriver after the script was executed. Deactivate to keep the WebDriver open and to append a column for the WebDriver to the output table, so that further actions can be executed with the WebDriver.
PortsDescription
▸ 0A configured factory which is used for creating the WebDrivers
▹ 1Table which provides data for the required variables used within the Selenium script. In case, the input table contains more than one row, the selected script is executed for each row, thus allowing to run the script with different variable inputs.
0 ▸Table with a boolean column indicating whether the Selenium script was executed successfully. In case the executed Selenium script set any variables, their values are appended as additional columns.

Extract Attribute#

This node extracts attribute values from a WebElement. For the specified attribute name, the attribute values are appended as string column to the input table. In case, an attribute is not present, a missing value cell is appended.

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
Attribute nameThe name of the attribute
PortsDescription
▸ 0Table with a column providing WebElements to extract
0 ▸Table with appended column holding the values of the attribute

Extract CSS property#

This node extracts a CSS property from a WebElement. For the specified CSS property name, the property values are appended as string column to the input table. In case, a CSS property is not present, a missing value cell is appended.

Note: "Shorthand" CSS properties such as background, font, border, etc. are usually not supported, instead you must use the explicit longhand property names, such as background-color, font-size, etc.

Color values are returned as RGBA strings, e.g. for a color property green Selenium will return rgba(0, 255, 0, 1).

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
CSS value nameThe name of the CSS property to extract
PortsDescription
▸ 0Table with a column providing WebElements to extract
0 ▸Table with appended column holding the specified property value

Extract InnerHTML#

This node appends a WebElement's text content by extracting the innerHTML or outerHTML property via JavaScript.

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
PortsDescription
▸ 0Table with a column providing WebElements to extract
0 ▸Table with appended column holding the inner/outerHTML values

Find Elements#

Extracts WebElements based on different criteria. The input can either be a WebDriver (representing a browser's window), or a WebElement (a subpart of the window). The following search criteria are available:

Find byExplanation
Class NameFinds elements based on their class attributes. In case an element has multiple class values assigned, matching a single value is sufficient.
CSS SelectorFinds elements based on a CSS selector expression.
IDFinds an element based in its id attribute.
Link TextFinds links through an exact match of their text.
NameFinds elements based on their name attributes.
Partial Link TextFinds links by a partial match of the given text.
Tag NameFinds elements based on their tag names.
XPathFinds elements based on an XPath expression.

For each extracted WebElement a new row is added to the output table.

Note that you cannot only search within the given input, but also navigate the entire DOM tree. For example, you can use the XPath query .. to find a WebElement's parent.

In case you need to extract an element which is not immediately available on the page, consider specifying an Implicit wait within the Start WebDriver's Timeouts options.

OptionDescription
Find inThe input column providing the starting point where to search.
ByThe search criterion (see above).
QueryThe query.
Change result column nameEnable to change the name of the appended column.
Extract first match onlyIf enabled, extract only first match per input row instead of all.
Wait for X seconds maximum, poll every Y msSpecify the maximum amount of time in seconds to wait in case elements are searched and are not immediately available. Additionally, the poll interval in milliseconds can be specified. Selenium will wait at most for the given amount of time and keep checking in the given poll interval.
Ignore exceptionsDo not fail the node's execution in case an exception is encountered (typically, in case the wait timeout was reached without finding an element).
Append additional WebElement informationIf enabled, additional columns with the WebElement's properties are appended (tag name, text content, selected, enabled, displayed state, position and size). This may (1) slow down extraction or (2) not be supported by specific WebDriver implementations, in latter case MissingValues will be returned.
PortsDescription
▸ 0Table with a column providing a WebDriver or WebElements in which to search
0 ▸Table with the found WebElements (and optionally additional columns with more information)

Frame#

This node allows to select an HTML frame on a page. The frame can be located by different methods. After execution, the WebDriver operates within the selected frame. To go back to the parent frame afterwards, run this node with the "Back to parent frame" option.

OptionDescription
WebDriver inputInput column which provides the WebDriver(s)
IndexSelect a frame by its (zero-based) index.
Name or IDSelect a frame by its name or ID.
WebElementSelect a frame using its previously located WebElement.
Back to parent frameSwitch back to the parent frame.
Default contentSwitch either to the first frame on the page, or the main document when a page contains iframes.
PortsDescription
▸ 0Table with a column providing a WebDriver in which to select a frame
0 ▸Same as input table

Get Pooled WebDriver [BETA]#

This node works similarly to the Start WebDriver node, except that it relies on a global pool of WebDrivers respective browsers. When the node is executed, it will try to retrieve an existing, idle WebDriver with the specified configuration from the pool, and only start a new one in case no WebDriver is available.

Instead of quitting the WebDriver (e.g. by resetting this node, or by running a Quit WebDriver node), it is handed back to the pool and can be reused later. WebDrivers managed by the pool will be quit simultaneously with KNIME.

The node performs a simple health check before handing out a pooled WebDriver. In case a WebDriver is not responding (e.g. because it has crashed, or it was killed by the user) it is eliminated from the pool.

Note, that the pooling mechanism is primarily intended for speeding up workflows which would start new browsers very frequently (e.g. in a busy loop). Pooled drivers keep their settings (cache, cookies, data, history, etc.), it is therefore not advisable to use the pooling mechanism when you require a “clean” browser, e.g. during testing.

Tab, OptionDescription
Options
URLThe URL to load (optional)
Timeouts
Page load timeoutThe timeout for a page load to finish in milliseconds.
Script timeoutThe timeout for asynchronous scripts in milliseconds.
Implicit waitThe amount of time to wait in case an element is searched in the DOM and it is not immediately available.
PortsDescription
▸ 0A configured factory which is used for creating the WebDrivers
0 ▸A table with one row and column providing the WebDriver

Highlight#

Highlights WebElements by creating a border around them. The color and size of the border are taken from input row's size and color properties (as specified by the Color Manager and Size Manager nodes).

OptionDescription
InputInput column which provides the WebElement(s)
PortsDescription
▸ 0Table with a column providing WebElements to highlight
0 ▸Same as input table

Navigate#

Navigates the selected WebDriver. The navigation types “URL”, “Back”, “Forward”, and “Refresh” are supported.

OptionDescription
InputInput column which provides the WebDriver(s)
Navigation typeThe navigation type to perform
URLThe destination URL in case the type “URL” was selected
PortsDescription
▸ 0Table with a column providing a WebDriver
0 ▸Same as input table

Page Source#

Adds a column with the currently loaded page source (i.e. the DOM) of the selected WebDriver. In case, the page was modified by JavaScript after page load, there is no guarantee, that the returned source actually reflects the currently displayed page (this depends on the selected WebDriver, see individual WebDriver documentation for more information).

OptionDescription
InputInput column which provides the WebDriver(s)
PortsDescription
▸ 0Table with a column providing a WebDriver
0 ▸Table with an appended column containing the WebDriver's current HTML source as string

Quit WebDriver#

This node quits a Selenium subworkflow by closing the WebDriver which was initially opened by a Start WebDriver node. This means that the browser instance opened at the beginning of the workflow is closed by this node. The node checks all rows and columns of the provided table for WebDriver cells.

PortsDescription
▸ 0A table which should contain a WebDriver (in case it contains multiple WebDrivers in different rows or columns, all of them are closed)
0 ▸Same as input table, but with all Selenium-specific columns (WebDriverCell and WebElementCell) removed.

Select#

Allows selecting or deselecting options within a menu which is represented by select tags. Selections can be made by different criterions: By numeric zero-index (e.g. select first element in a select), by an option's value, by an option's text, or simply selecting all options.

Note: In case you are trying to select multiple elements and the corresponding select construct does not have a multiple attribute, an error is thrown.

OptionDescription
InputInput column which provides the select WebElement(s)
ActionThe action to take (select or deselect)
Select byThe criterion for the select or deselect
PortsDescription
▸ 0Table with a column providing WebElements to select
0 ▸Same as input table

Send Keys#

Simulates typing into a WebElement which accepts text. You can send special keys using belows's code. Just copy the "representation" into the input. The "Null" key as used as termination for sending sequences; e.g. to send Ctrl+A, enter \uE009a\uE000.

KeyRepresentation
Null\uE000
Cancel\uE001
Help\uE002
Backspace\uE003
Tab\uE004
Clear\uE005
Return\uE006
Enter\uE007
Shift\uE008
Control\uE009
Alt\uE00A
Pause\uE00B
Escape\uE00C
Space\uE00D
Page Up\uE00E
Page Down\uE00F
End\uE010
Home\uE011
Arrow Left\uE012
Arrow Up\uE013
Arrow Right\uE014
Arrow Down\uE015
Insert\uE016
Delete\uE017
Semicolon\uE018
Equals\uE019
Numpad 0\uE01A
Numpad 1\uE01B
Numpad 2\uE01C
Numpad 3\uE01D
Numpad 4\uE01E
Numpad 5\uE01F
Numpad 6\uE020
Numpad 7\uE021
Numpad 8\uE022
Numpad 9\uE023
Numpad Multiply\uE024
Numpad Add\uE025
Numpad Separator\uE026
Numpad Subtract\uE027
Numpad Decimal\uE028
Numpad Divide\uE029
F1\uE031
F2\uE032
F3\uE033
F4\uE034
F5\uE035
F6\uE036
F7\uE037
F8\uE038
F9\uE039
F10\uE03A
F11\uE03B
F12\uE03C
Meta / Command\uE03D
Zenkaku / Hankaku\uE040
OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
TextThe text to send
PortsDescription
▸ 0Table with a column providing WebElements to which to send keys
0 ▸Same as input table

Start WebDriver#

This node starts a Selenium workflow by creating a new WebDriver. A WebDriver serves as an interface to a web browser, and allows to open web pages, control the browser, and extract data from it. The actual WebDriver to use must be configured using an upstream WebDriver Factory node.

The WebDriver is automatically closed, when this note is being reset, or the workflow or KNIME is closed. Additionally, you can explicitly close the browser with a Quit WebDriver node.

Important note: Because of the way Selenium works, KNIME workflows using the Selenium Nodes behave differently than you might be used from other nodes. As a Selenium workflow relies on a running browser instance, it is for example not possible to re-run a saved KNIME workflow from in between after it has been loaded from disk. In such cases, you need to re-run the workflow starting from the initial Start WebDriver node, as the downstream Selenium nodes require a WebDriver instance for operation.

Tab, OptionDescription
Options
URLThe URL to load (optional)
Timeouts
Page load timeoutThe timeout for a page load to finish in milliseconds.
Script timeoutThe timeout for asynchronous scripts in milliseconds.
Implicit waitThe amount of time to wait in case an element is searched in the DOM and it is not immediately available.
PortsDescription
▸ 0A configured factory which is used for creating the WebDrivers
0 ▸A table with one row and column providing the WebDriver

Submit#

Causes a form submit, in case the WebElement is either of type form form, or it is contained within a form. If the submission causes a new page to load, the action will block until the page has loaded. In case the element the element is neither a form, nor contained in such, running this node will cause an error.

OptionDescription
InputInput column which provides the WebElement(s)
Remove input columnRemoves the input column from the result table
PortsDescription
▸ 0Table with a column providing WebElements to submit
0 ▸Same as input table

Synchronize#

This node serves as a helper to synchronize a branched Selenium workflow. In case a Selenium workflow consists of parallel branches, and one wants to wait at a certain point until all branches have finished, all the branches can be connected to input ports of this node. Further execution blocks until all branches are available. The output port of this node provides the (unmodified) input of the first input port.

PortsDescription
▸ 0The first input table
▹ 1The second input table
▹ 2The third input table
0 ▸The unmodified table of the first input port

Table Extractor#

This node conveniently converts HTML tables into KNIME tables. It uses some simple heuristics to determine the column names. The result are three KNIME tables. The first KNIME table contains the HTML table’s content, the second and third KNIME tables contain the HTML table’s header and footer.

As KNIME supports no spanning rows or columns, rowspan and colspan attributes in the HTML table are mapped by simply copying the original cell’s content to the spanning cells.

The HTML table’s header is detected by checking, whether (1) all cells are of type th, or (2) the cells are contained within a thead element. The HTML table’s footer is detected through the tfoot element.

The KNIME table’s column names are generated from HTML table’s header. In case the header is a single row, the column names equal the HTML table’s header names. In case there is more than one row in the HTML table’s header, the rows are concatenated with “ > ”. In case the HTML table contains no header, the column names are synthetically generated (“column0”, “column1”, …)

Here’s an example HTML table:

Header A
Header BHeader CHeader D
Cell 1Cell 2Cell 3
Cell 4Cell 5
Cell 6Cell 7

This will result in the following KNIME content table:

Header A > Header BHeader A > Header CHeader A > Header D
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 5
Cell 4Cell 6Cell 7

And the KNIME header table:

Header A > Header BHeader A > Header CHeader A > Header D
Header AHeader AHeader A
Header BHeader CHeader D

The footer table would be empty in this example, because the HTML table contains no footer.

OptionDescription
InputInput column which provides the WebElement which resembles the table
Create missing values for missing cellsIf this option is checked, missing value cells (instead of empty string cells) will be created for those cells, which are not explicitly defined within the HTML table.
PortsDescription
▸ 0Table with a column providing a WebElement which resembles the table to extract
0 ▸The table content
1 ▸The table’s header data
2 ▸The table’s footer data

Take Screenshot#

Take a screenshot of the currently loaded page in the selected WebDriver. The WebDriver must support taking screenshot, else an error is triggered (e.g. the HtmlUnitDriver does not allow to take screenshot, as it is not running within a GUI). The extent of the resulting screenshot depends on the actual WebDriver (some WebDrivers capture the entire page, or the current window, or the visible frame, or the entire screen).

OptionDescription
InputInput column which provides the WebDriver(s)
PortsDescription
▸ 0Table with a column providing a WebDriver
0 ▸Table with an appended column containing the screenshot as image cell.

Wait#

This node simply pauses the execution for the specified amout of time. It can be used within Selenium workflows to wait for asynchronously loaded data.

OptionDescription
TimeThe time to wait in milliseconds.
PortsDescription
▹ 0Input table
0 ▸The unmodified table of the input port

WebDriver Factory#

This node is responsible for configuring a WebDriver Factory. The WebDriver Factory creates new WebDrivers which are required for example by the Start WebDriver node. The node's configuration allows to select a concrete WebDriver implementation. The following WebDrivers are supported (further can be added through an extension point):

All WebDrivers except HtmlUnit, PhantomJS, and the RemoteWebDriver open an actual browser window on your machine. This means, that the browser needs to be installed and accessible on your system. Usually, the browsers can be found automatically, in case they are available in the system's path variable or they are present at system-specific standard locations. See the WebDriver-specific documentations above for more information.

HtmlUnit and PhantomJS work in a headless manner and do therefore not open any visible windows.

The RemoteWebDriver allows to connect to a remote browser which is running on a Selenium server. See here for more details about the server side. You may also use this option to connect to third party, cloud-based Selenium services such as BrowserStack.

Capabilities for the WebDriver can be configured using the key-value editor. This is relevant when you need a to set specific browser settings or a proxy configuration. See here for a documentation. It's also needed when running a RemoteWebDriver to specify which platform, browser, and browser version to use. In case, you're using a third party service for running your RemoteWebDriver refer to the corresponding documentation (e.g. capabilities for BrowserStack can be found here).

OptionDescription
WebDriverThe WebDriver to use
Remote URLThe URL in case a remote WebDriver is selected
SnippetsSnippets with predefined configurations for the currently selected WebDriver; choose a snippet in the menu and click “Merge” to add it to the capabilities list, or “Replace” to clear the current capabilities before adding it. Note, that snippets are not available for all WebDrivers.
CapabilitiesTree with key-value pairs with capabilities
Test WebDriverPerform a test run with the current configuration; a new WebDriver is opened and a test page is loaded, and the WebDriver is closed again in order to check whether the configuration is correct.
PortsDescription
0 ▸A configured WebDriver factory.

Window#

This node allows to resize, maximize and position the WebDriver's window. Beside that, the current dimensions can be retrieved.

OptionDescription
InputInput column which provides the WebDriver(s)
Set sizeActivate to set a size for the window
Set positionActivate to set a position for the window
MaximizeActivate to maximize window
Get dimensionsActivate to append columns with the size and position of the window
PortsDescription
▸ 0Table with a column providing a WebDriver
0 ▸Same as input table, optionally with four additional columns for position and size of the WebDriver's window