Forum Discussion

kumar_perlaa's avatar
kumar_perlaa
Contributor
12 years ago

Object does not support this property or method-JScript Run time Error Message

Hi  There,

 When I am invoking  TimeToExpiries() method in below methods, I am getting below error message at method 2. All methods are in the same unit. as per c++ syntaxt it suppose to work,but it's not working. Please refer the screenshot also...

 

Code Snippet:

 

 

  Method 1:

 

Function Method1()

{

  TimeToExpiries() ;// This is working fine;

}

 

Method 2:

Function ModelIteration_Result_Table_Log ()

{

 TimeToExpiries() ;// Getting Error Message here,see below screen shot.

 

}

 

TimeToExpiries()

{

 // its returning object reference.

}

Error Message:

 

Object does not support this property or method.

Could you please help me out regarding this issue by giving sample code or taking one simple example and explain to me. Thank you.

5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kumar,


     


    Is "ConfigurationMgmt" a script unit where the ModelIteration_Result_Table_Log function is declared? Do you call the TimeToExpiries function from Method1 in the way specified in the attached screenshot? As far as I understand, Method1, ModelIteration_Result_Table_Log and TimeToExpiries are declared in the ConfigurationMgmt unit, right?


     

  • Hi Tanya,



    Thanks for the reply !!. This issue has been fixed. Let me answer your Q's. Please see my answers below:




    Is "ConfigurationMgmt" a script unit where the ModelIteration_Result_Table_Log function is declared?----> Yes



    Do you call the TimeToExpiries function from Method1 in the way specified in the attached screenshot? ----> Yes and also the code is working

     

    As far as I understand, Method1, ModelIteration_Result_Table_Log and TimeToExpiries are declared in the ConfigurationMgmt unit, right?----> Yep.





    Few questions to you wrt TC and Jscript:

    Is TC supports FunctionOverloading?

    Is TC supports FunctionOveriding?

    Is TC supports Inheritence?

    Is TC supports Public scope of variables in JScript?



    As per my knowledge ,TC does not support above...Please correct me,if I am wrong?



    Kumar

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kumar,


     


    Could you please answer (to satisfy my curiosity :) ) how you resolved the problem?


    As for your questions, TestComplete uses JScript v. 5.7. So, if this version supports all of these, you can use them in TestComplete.