Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 477 Vote(s) - 3.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot access current Test Name in TestComplete

#1
We have the method below which is trying to log the name of the test currently being executed


function Test()
{

var TestItems;

TestItems = Project.TestItems;
Log.Message("The " + TestItems.Current.Name + " test item is currently running.");
}

This is being run in TestSetup

This is just resulting in a very unhelpful JScript error

> Object required

Stepping through, it appears as though Project.TestItems is assigned, but not Current

Has anyone ever had this problem?

We are using TestComplete using JScript as the scripting language

Project.TestItems is the object that Test Complete says to use to get information about the Project being run. As I mention above, there is information about the Project and Project.TestItems but TestItems.Current is null

Its as if I am calling this too early but I cant see where else to call it. It is being called in TestSetup

Paul
Reply

#2
Try to use `Project.TestItems.Current.ElementToBeRun.Caption` instead of `Project.TestItems.Current.Name`.
But you should run this scipt from Project TestItem page.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through