Return [object Object]
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Return [object Object]
Hi, i have a problem with this script. count return value [object Object]... why? Where i do mistake? This script should return ..
I need..
my Method
function getDuplicates() {
uniqueCount = ["a","b","c","d","d","e","a","b","c","f","g","h","h","h","e","a"];
var count = {};
uniqueCount.forEach(function(i) { count[i] = (count[i]||0) + 1;});
Log.Message(count)
}
Thank you
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @David91.
I believe the problem you are having is that testcomplete isn't converting the count object to a string to log as a message. If you stopped testcomplete during debugging you would see counts' properties/fields and their associated values (first image). If you want these to log as a string you will need to walk the object's fields (using aqObject.GetFields) and concatenate the field names and field values to a message string, like this...
The logged messages
I hope this helps.
