Testing a Graph
  • 23 Aug 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Testing a Graph

  • Dark
    Light
  • PDF

Article summary

We have included an Interactive Training to provide a more engaging and visual learning experience. End users are required to complete their training through the CSG University.


Xponent allows graphs and nodes to be tested interactively before deployment. This enables the testing of individual components using user-supplied test cases, by specifying one of the input data JavaScript objects, a number of iterations of a graph, or by specifying a fixed time duration.

Graphs can only be tested when they are valid.

Click on the Validate button located at the top of the graph to test the Graph validity, or this will be pushed automatically if the start button is pressed. 

The valid graph icon is displayed at the top right of the graph window if the graph is Valid.

The valid graph icon is displayed at the top right of the graph window if the graph is Invalid.

It is unnecessary to manually validate the graph as the graph will be automatically validated before the testing console is opened, and any errors will prevent it from opening.

The Testing Console

The testing console is available at the bottom of the graph window. It 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:

  • Start: Starts the graph engine and shows the Testing Settings window. They have shown grey when the graph is executing. The Start button is only available for a valid graph.
  • Stop: Stops the execution of the current graph. Shown as green when the graph is executing.
  • Clear Logs: Clears out the Testing Console and removes information from all previous runs.
  • Maximize and minimize: 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. The number of iterations for listener graphs 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: 

  • The 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. The 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 highlighted in orange and display detailed error messages from the engine. 

If you have different engine groups pointing to different testing environments, 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 a dark blue highlight. 


Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence