Forum Discussion

pjageronimo's avatar
pjageronimo
Contributor
12 years ago

Invoking TestExecute via COM throws System.NullReferenceException: Object reference not set to an instance of an object.

Hi All,



My team is currently writing a VB.Net program that launches scripts via TestExecute controlled by the VB.Net app. We've followed the code written in the help file (can also be found here but doesn't have the VB.Net sample code )



A simple copy/paste was done and the app was compiled, upon running. it threw the error:



System.NullReferenceException: Object reference not set to an instance of an object.



in the line of code here:

Select Case IntegrationObject.GetLastResultDescription.Status

                Case TestComplete.TC_LOG_STATUS.lsOk

                    System.Windows.Forms.MessageBox.Show(Me, "The test run finished successfully.")

                Case TestComplete.TC_LOG_STATUS.lsWarning

                    System.Windows.Forms.MessageBox.Show(Me, "Warning messages were posted to the test log.")

                Case TestComplete.TC_LOG_STATUS.lsError

                    System.Windows.Forms.MessageBox.Show(Me, "Error messages were posted to the test log.")

            End Select



Is there something we need to configure within TestExecute or Visual Studio?

  • Looks like it's taking too long to open my Project.



    I've checked the code:

    While IntegrationObject.IsRunning

                    Application.DoEvents()

    End While




    The code exited in the loop even though the unit script is not yet ran.



    The property IsRunning doesn't work as expected
  • I think i've cracked this... TestExecute throws unhandled error because the pjs and mds files are READONLY.



    Next... removing READONLY attribute of files and folders