Troubleshooting

This document provides troubleshooting advice for various Natural Screen Tester topics:


Test Project Map

An individual screen thumbnail within the Test Project Map can indicate problems or incompatibility between the defined identifiers and the screen image attached to the screen. Such problems are indicated by a red frame around the specific screen.

Possible problems:

  • Incompatibility between the defined identifiers and the screen image attached to the screen. This can happen as a result of creating a screen and then manually changing an identifier.

  • The screen suits the screen image, but there is a screen which is more suitable or identical to the screen image. Look at the name of the screen which is on the screen image and check that it suits the current screen. Note that the name which is on the screen image indicates how the server identified this screen image given all current screen definitions.

See Test Project Map in the Designing and Developing a Test Case documentation for more information.

Connection Pools

Symptom Explanation Possible Reasons How to Check
All my connections are broken Host sessions become broken if they cannot get to Ready state. Ready means that:
  1. The connection is alive.

  2. If an "initial screen" is defined by the pool, the session must get there.

Host is unavailable. Try to connect to the host without the pool.
Initialization path needs to be modified. Create a connection outside the pool, run the initialization path and verify it gets to the "initial screen".
Connections disconnect after use but I want to reuse them The pool may be configured to allow reusing a host connection that was used by a previous user. This would require returning the connection to the initial screen, either by implementing a robust navigation logic inside the invoked procedure or in the recycle path. The Disconnect after usage option is checked. Observe the state of the Disconnect after usage checkbox in pool tab of the connection pool.
The logic of the user activity or the recycle path causes a disconnection from the host. Capture a trace file for the user activity and recycle path. Observe that the host session is not terminated during the invocation of user activity or the recycle path.
When a connection is returned to the pool and it is not in the "initial screen", and there is no recycle path that successfully navigates to the initial screen. Capture a trace file for the user activity and recycle path. Observe that at the end of the user activity and the recycle path invocation, the connection is in the initial screen.
Connections remain Active after use Upon finishing the user activity on a pool connection, the state of the connection would change according to the pool configuration and the state of the user session. The state of the connection would remain active if the session used by the pool has not ended. A flow procedure creates an emulation session on a pool connection, but the "end session" node is not called on that session. Verify the existence of an "end session" node in the flow procedure that creates the emulation session. Verify that the "end session" node is reached by capturing a trace file or by logging the invocation of the flow procedure.
Connections remain Terminating after use A pool may be terminating a connection based on the pool's configuration, connection count and the status of the session. When doing so, the connection status would become "Terminating" and the termination path would run on the connection. After the termination path is completed, the connection is removed from the pool. An exception in the termination path is causing the host connection to either get stuck or to terminate before completing the path. Capture a trace file that includes the invocation of the termination path and observe that the path has completed successfully. Search for exceptions in the server logs that occurred during the invocation of the termination path.
A used connection is disconnecting while being used   The host is disconnecting the pool connection based on the user activity or due to the host state. Capture a trace file for the user activity, observe the last packet transmissions between the server and the host. Look in the server log for an error indicating a socket close around this timestamp. Also ask the host administrator to inspect the host's log for disconnections.
Another host connection is using the same host credentials/device name and hijacking the session. When capturing trace files, you would notice a trace file created at the time when a previous trace file is closed. Both traces will include send sections containing the same credentials or device name.

Note:
When recording trace files to capture the symptoms mentioned above, we recommend using the following variables in the trace file name: connection ID (%c), session ID (%u), creation time of file (%t). See Recording Trace Files for more information.

See Connection Pools in the Designing and Developing a Test Case documentation for more information.

Natural for UNIX APX Component

To troubleshoot problems in the APX component's functionality it is possible to define tracing its activity. The daemon and the Natural application with the APX lib can be traced separately. In order to determine which of the two components' activity should be traced follow these guidelines: when the problem seems to be to do with connecting the Natural Screen Tester Server to the APX daemon (including authentication problems), trace the daemon component. For any other problems trace the Natural application. Note that it is not recommended to use the trace file in the production environment on a regular basis.

Start of instruction setTo trace the APX daemon

  1. Go to the $NATDIR/$APXNODE directory.

  2. Edit the apxsrvd.sh file.

    Find EXECUTABLE=apxsrvd, and change it to EXECUTABLE=apxsrvd.tr

  3. Define the following environment variables (the following is an example of how these should be defined in sh/bash):

    > PT_TRACELEV=i6000
    > SAGTMP=$HOME/tmp
    > export PT_TRACELEV
    > export SAGTMP
    

    The trace files are created in the $SAGTMP directory. In the example above this is $HOME/tmp.

  4. Restart the daemon:

    > apxsrvd.sh servicename stop
    > apxsrvd.sh servicename start

    or

    > apxsrvd.sh portnumber stop
    > apxsrvd.sh portnumber start

Start of instruction setTo trace the Natural Application with the APX library

  1. Go to the $NATDIR/$APXNODE directory.

  2. Edit the apx.sh file.

    $NATDIR/$NATVERS/bin/natapx parm=$PARAMETERS etid=$$ >/dev/null 2>&1

    Change natapx to natapx.tr

    Uncomment (by removing the # from the beginning of the rows) the TRACE section.

The trace files are created in the $SAGTMP directory.

By default it is $HOME/tmp. It will take effect when next connecting to the daemon.

See Setting up the APX Component for more information.

Web Procedures

See Web Procedures for more information.

What to do when the Web Procedure Fails to Run

The Web Procedure can fail to run for a number of reasons such as an element cannot be found on the page or unexpected behavior when running JavaScripts. Some of these issues can be solved by adjusting parameters in the <NSR-installation>/config/gxconfig.xml file. Following is a list of possible problems with a recommendation as to what to do and when relevant, which parameter to configure. Below is a snipet of the code as it appears within the gxconfig.xml file.

Timeout error: When running the Web Procedure, sometimes an error message is displayed indicating that a timeout occurred, and that the procedure failed and did not run successfully. This can be for a number of reasons:

  • A specific element used in the procedure was not found on the page. In this case, you should try the following:

    1. The XPath defined may not capture the correct element. Run the procedure from within the Designer and follow the output in the Console area.

    2. Refine the XPath to make it more robust. Refer to What is an XPath?

    3. Change the server log level to "trace" to help you understand where the problem may lie.

    4. If you know that this element is on the page, you should try to change the waitElementTimeout parameter and see if after extending this time the element is found.

  • Required resources are not loaded on the page within a certain amount of time. You can confirm that this is your problem by setting the log level to "trace" and see that the actions/web element content retrieval is performed on the previous page. Change the navigationTimeout parameter to try and solve this.

Unexpected behavior when running JavaScript methods: If in a scenario which relies on the execution of a JavaScript method, the results are not as expected. Changing the javascriptTimeout may solve this.

CSS related problem: When there is a scenario that relies on the evaluation of CSS rules, and the results are not as expected, setting the cssEnabled parameter to enabled may solve this.

<MainConfiguration>
        ...
        <ServerConfiguration>
        ...
           <webProcedureConfig>
                <waitElementTimeout>30000</waitElementTimeout>
                <navigationTimeout>90000</navigationTimeout>
                <javascriptTimeout>30000</javascriptTimeout>
                <cssEnabled>false</cssEnabled>
           </webProcedureConfig>
        </ServerConfiguration>
</MainConfiguration>

Error Messages

RC Error Message Explanation Possible Reasons What should I do?
5005 ERROR SOCKET Error communicating with Natural Screen Tester Server May occur as a result of incompatible client and server version. Check the Natural Screen Tester Server version (see server log) and the client version (see client log) and make sure they are of the same version and build number.
If the host decides to close the connection with the Natural Screen Tester Server, the session in the server will be disconnected and the client will receive a 5005 error, indicating that the Natural Screen Tester session is no longer active. Host failure or network issue that made it offline. Probably more details in the host logs. Catch this error in the client web application and act accordingly. Look into the host logs for more details.
5002 ERROR CANNOT CONNECT TO HOST When opening a Web application page we get the following error:
  1. Missing or insufficient permissions

  2. The host is offline.

  3. Password expired (Natural under UNIX).

Check user credentials.
n/a Error evaluating the expression In earlier versions, NULL and empty string were almost the same. From version 9.8 they are not, and you should actively use options like isNull() or put in a default value to avoid these errors. Usually these errors appear after migrating procedures, see the error message in the log for more details. Look for "If" block with the empty string or look for inputs without the default value. The error log message should help you figure out where this is coming from.
n/a The repository is not available Usually happens due to a Java heap space problem. The JVM's XMX parameter memory allocation is low. Look into the server's launch config files (startup.bat / GXApplinXService.ini) and increase the -xmx value of the JVM.
n/a General Javascript errors The Framework's JavaScript engine encountered an error. Could be caused by a host key not responding, or screen that wasn't refreshed after entering a value to an input field. Open the browser's developer tools and use them to debug the scenario until you pinpoint the root cause.
5051 Procedure Exception: Cannot run procedure proc_name, error getting host connection, error code Service fails to run on the local server. The error code should be "ERROR_SERVICE_NOT_ACTIVE". Connection pool isn't active. Check connection pool configuration. If it is set to "when first accessed", change it to "manual".
n/a Replayer configuration doesn't match the current host configuration. When running a trace file from the designer there should be a match between the Replayer to the current host configuration. Replayer configuration doesn't match the current host configuration. For example, the Replayer Expected Model is 5 and the Host configuration Model is 2. Open the Host configuration and change the host configuration according to the trace file.