Icon

Selenium_​Error_​Handling

The workflow demonstrates how to handle errors in Selenium Nodes workflows.

Crucial parts:

* A list of URLs to process within a loop
* Try/catch handling within each loop because operations can fail (here: page load timeout)
* Keep error messages for each iteration and feed them to the result table

Inner loop -- this will be repeated for each iteration These nodes can potentially fail. In this example, the page loadtimeout of 3 seconds will be reached which will cause the “Navigate”node to fail Node 1Set a load timeout of 3 secondsNode 3Node 4Some dummy URLs which have varying load times of 1 … 5 secondsThe URLs which load longer than five seconds will produce an error, as we set a maximum page load timeout of 3 secondsJust a simple example:Extract the entire pagesource into one columnImportant:Ensure to enable“Allow changing table specifications”Node 8Node 9This node just produces some dummy data to feed into the Catch nodeThe error information is provided as flow variables – convert them into a table structureHack: Combine the upper connection (if execution succeeds) ORthe error message (if execution fails) into one tableNode 14Node 15 WebDriver Factory Start WebDriver Navigate Table Row ToVariable Loop Start Table Creator Page Source Loop End Try (VariablePorts) Catch Errors(Data Ports) Table Creator Variable toTable Row Cross Joiner Quit WebDriver Column Filter Inner loop -- this will be repeated for each iteration These nodes can potentially fail. In this example, the page loadtimeout of 3 seconds will be reached which will cause the “Navigate”node to fail Node 1Set a load timeout of 3 secondsNode 3Node 4Some dummy URLs which have varying load times of 1 … 5 secondsThe URLs which load longer than five seconds will produce an error, as we set a maximum page load timeout of 3 secondsJust a simple example:Extract the entire pagesource into one columnImportant:Ensure to enable“Allow changing table specifications”Node 8Node 9This node just produces some dummy data to feed into the Catch nodeThe error information is provided as flow variables – convert them into a table structureHack: Combine the upper connection (if execution succeeds) ORthe error message (if execution fails) into one tableNode 14Node 15WebDriver Factory Start WebDriver Navigate Table Row ToVariable Loop Start Table Creator Page Source Loop End Try (VariablePorts) Catch Errors(Data Ports) Table Creator Variable toTable Row Cross Joiner Quit WebDriver Column Filter

Nodes

Extensions

Links