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:
  • 370 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TestComplete Objects - Enumerate properties

#1
For the TestComplete objects of processes, windows and controls on the screen - is there a way to enumerate and print out all the properties. I tried the following code and I get a runtime exception:-


var deskObj = Sys.Desktop; //TC Desktop Object
var normObj = {a:1, b:2, c:3}; //Normal JScript Object

for (var prop in normObj)
{
Log.Message(normObj[prop]); //1, 2, 3
}

for (var prop in deskObj) //Runtime error - Object doesn't support this action
{
Log.Message(deskObj[prop]);
}

This leads me to believe that TC Objects are not quite JScript objects - so is there a way to convert these to JScript Objects.
Reply

#2
That's right: objects from the Sys tree (the object tree in the Object Browser) are special COM wrappers for actual application objects. They are not common JScript objects.

To get the list of properties and methods of such TestComplete objects, you can use the [GetProperties][1] and [GetMethods][2] methods of the [aqObject][3] object. You can find sample code within the corresponding help topics.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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