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,
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 }
Important: This node cannot be used for HTTP authentication dialogs, as these
cannot be controlled through JavaScript resp. Selenium. In case you need to authenticate this
way, you can send the credentials directly through the “Navigate” node. Add username and password
to your URL like this: https://username:password@example.com
(works with Chrome-based
browsers and Firefox)
You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension Selenium Nodes for KNIME from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com, follow @NodePit on Twitter, or chat on Gitter!
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.