Forum Discussion

scot1967's avatar
scot1967
Regular Contributor
11 days ago
Solved

Asynchronous Methods in TC

Are native JavaScript ECMA 6 methods like await, Promise, resolve and the async keyword fully supported in TestComplete?  I have working code using these methods but want to ensure the use of these methods is fully supported.  I know as of version 12 ECMA 6 became supported.  Just looking for verification on these methods and keywords.

Thanks!

Christopher S. Holmes

Development Support Analyst

WW Wood Products inc.

 

  • scot1967's avatar
    scot1967
    10 days ago

    I have found the commands referenced in this article do not support stored procedure calls but instead focus mainly on dealing with modal dialogs and windows. 

    It is not recommended to use this method to perform asynchronous calls to methods provided by TestComplete (that is, to methods that are provided by TestComplete but not by the application under test).


    I finally found this reference so it looks like Promises, async, await and resolve are (officially?) supported as of version 14 and maybe before (v12 when ECMA 6 became supported?).  This holds true for the code I have written. 

    https://support.smartbear.com/testcomplete/docs/general-info/version-history/bugs-fixed-in-ver-14-10.html#script-tests

    Script Tests

    • Fixed: When searching for all occurrences of a function call in VBScript units, TestComplete ignored function calls that had a space between the function name and its arguments.
    • Fixed: TestComplete could exit unexpectedly when calling the async and await methods in JavaScript.
    • Fixed: TestComplete could exit unexpectedly when running the Promise.resolve() method in JavaScript.
    • Fixed: The Code editor failed to scroll down if word wrapping was enabled and the last line wrapped multiple lines.
    • Fixed: TestComplete could exit unexpectedly when running a script test or when the user was editing a script test."