Testing a Graph


Xponent allows graphs and nodes to be tested interactively prior to deployment. This allows the testing of individual components using user supplied test cases, by specifying one of an input data JavaScript object, a number of iterations of a graph or by specifying a fixed time duration. Graphs can only be tested when they are valid. Graph validity can be tested explicitly by pressing the  button at the top of the graph or this will be tested automatically if the start button is pressed. If the graph is valid the valid graph icon is displayed at the top right of the graph window.  It is not necessary to validate the graph manually as the graph will be automatically validated before the testing console is opened and any errors will prevent the testing console opening. 

The Testing Console

The testing console is available at the bottom of the graph window and provides insight into the execution of each step in the graph and the state of the data store and public variables at the end of the execution. The testing console bar provides four buttons for control of the testing console. From left to right: 

  • - Starts the graph engine and shows the Testing Settings window. Shown grey when the graph is executing. The Start button is only available for a valid graph. 
  •  - Stops the execution of the current graph. Shown as green when the graph is executing. 
  •  - Clears out the Testing Console and removes information from all previous runs 
  •  - Maximize or minimize the Testing Console. The Console can also be enlarged or shrunk by grabbing the bar between the graph window and the console and moving it up or down 


Testing Settings 

At the start of each execution, after the Start button has been pressed, the Testing Settings window will appear. For a standard graph, without a listener, or most types of nodes, the window will look like this: 

This allows you to paste in some JSON data to be used as the input to the graph. This data could be the output of a previous graph test. 


If the graph has a listener then the Testing Settings window will show the three modes of testing the graph: 


There are three modes of testing graphs interactively: 

  • Iterations - for non-listening graphs the graph will always execute once. For listener graphs the number of iterations will limit the maximum number of times the graph is executed. 
  • Duration - specify the number of seconds that the graph should execute for - this is only applicable to listener graphs
  • Data - execute the graph using the supplied JSON data 

Note that during visual testing there are some limits on graph execution: 

  • Maximum number of iterations is 1,000 
  • Duration - the maximum runtime of any graph is 30 minutes

These limits are set so that interactive graphs don't lock up engines unnecessarily.  

Testing Console Output 

The testing console will show the  button if the graph is a listener. If the graph is not a listener then it will progress to the  state. 

The Testing Console displays the following information for every node executed in the graph: 

  • The name of the node and the type of the node if it is an adaptor
  • The execution time - usually in milliseconds
  • The return value of the node

The information in the testing console must be expanded using the  icon. Second and subsequent runs appear below the first run. 

After each execution the Data Store values for the schema and any public variables are also shown. The final state of the schema is available to be viewed and copied by pressing the Display JSON button. 

Errors are shown highlighted in orange and show the detail of the error message from the engine: 

Note: If you have different engine groups, pointing to different environments for testing, then please reference this support article for any missing transaction logs.

If the graph is a listener and there are multiple iterations then the graph will show the path for a particular transaction if the mouse is held over that transaction. The graph highlights the path with an dark blue highlight. 


Prev Up Next 

Privacy Policy
© 2022 CSG International, Inc.