Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
Yes, TestComplete has an evaluate function. In fact, I use it frequently. My code example below is DelphiScript but it should give you an idea of the capability.
Now, I don't think you can use Evaluate to evaluate a function, only an object. However, if you want do do a function call, you can do something like this.
Hope this helps!
P.S. Hi, gang! I'm back... been away too long...
Document := Sys.OleObject(XML_DOM_OBJECT);
Document.Load(BaselineDirectory + EVENT_TICKET_HOLD_BASELINE + VarToStr(Self.MessageID) + '.xml');
Log.Message(BaselineDirectory + EVENT_TICKET_HOLD_BASELINE + VarToStr(Self.MessageID) + '.xml loaded.');
//Create object for result
Log.Message('Attempting to create XML node: ' + MESSAGE_EVENT_TICKET_HOLD + VarToStr(Self.MessageID));
XML.CreateXML(MESSAGE_EVENT_TICKET_HOLD + VarToStr(Self.MessageID), Document);
//Compare! Easy peasy.
Comparison := Evaluate('XML.' + MESSAGE_EVENT_TICKET_HOLD + VarToStr(Self.MessageID));
Comparison.Options.IgnoreNodeOrder := True;
Comparison.Compare(Response.DOMObject);
Now, I don't think you can use Evaluate to evaluate a function, only an object. However, if you want do do a function call, you can do something like this.
Result := ODT.Classes.New('eGalaxyMessage');
Result := Runner.CallMethod('ODT' + aMessageType + 'Message.AddObjectSpecificProperties', Result);
Hope this helps!
P.S. Hi, gang! I'm back... been away too long...
Related Content
- 7 years ago
- 8 years ago
- 11 years ago
- 10 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago