Forum Discussion

Supa's avatar
Supa
New Contributor
15 years ago

VBScript Style used in TestComplete Vs QTP

This is a general curiosity why this way implemented in TC.



In QTP when record a script in format set the object and call its method in pure VBScript

eg for windows calc

Window("Calculator").Activate

Window("Calculator").WinButton("5").Click

Window("Calculator").WinButton("*").Click

Window("Calculator").WinButton("2").Click

Window("Calculator").WinButton("=").Click



In Test Complete same actions are recorded in following way 



Sub Test1

  Dim wndCalculator

  Set wndCalculator = Aliases.calc.wndCalculator

  Call wndCalculator.Click(143, 14)

  wndCalculator.btn5.ClickButton

  wndCalculator.btn.ClickButton

  wndCalculator.btn2.ClickButton

  wndCalculator.btn1.ClickButton

End Sub



In TC it is in more structred/procedural format.

Any guesses why it is been developed in such a way?

1 Reply

  • Hi,



    TC and QTP just have different object models and architecture.



    However, the two scripts you've posted here are quite similar. Your TC script is recorded with Name Mapping which is used to allow you to specify custom recognition parameters for objects of your application (by default, window class and caption are used).