Forum Discussion

kkc's avatar
kkc
Occasional Contributor
10 years ago

VB Runtime Error with The Case of the Method Name When Using ScriptExtension

I currently met a problem using ScriptExtension in TestComplete 9.31.3889.7. When I tried to call my method defined in ScriptExtension, there is always a VB runtion error.



My code is as follows:

=========================================


Sub VerifyMaintenanceScreen(ByVal strDriverName)


        Call Log.AppendFolder("Verify the data in the Maintenance Screen.")


        'Verify the fields


        HTML.TextBox.verifyvalue(id, value)


        Call Log.PopLogFolder


End Sub

=========================================



The runtime error is as follows:

=========================================


Object doesn't support this property or method: 'HTML.TextBox.VerifyValue'

Error location:

Unit: "BaseModule\BaseModule\Script\BASE_GeneralizedCodeGroup"

Line: 182 Column: 9.

=========================================



I didn't quite understand why I called method "HTML.TextBox.verifyvalue" but the TestComplete considered the method I called as  'HTML.TextBox.VerifyValue'.



Is this a bug or something?




8 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Kevin,



    You're missing Call before the verifyvalue method call:



    If you omit Call, you must also drop the parentheses around the argument list:

  • kkc's avatar
    kkc
    Occasional Contributor
    Yes, but after I have added Keyword "Call", the same error still exists.
  • kkc's avatar
    kkc
    Occasional Contributor
    The error still exist. I need help.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Kevin,

     


    Is HTML the name of the runtime object in your script extension? Make sure that all properties and methods of your object are properly created in the Description.xml file. Refer to the "Structure of the Description File" article for details.


     

  • kkc's avatar
    kkc
    Occasional Contributor
    Maybe I didn't explain the issue clearly. The problem is the method I define in ScriptExtension is "verifyvalue" (all characters are in lower case) and the method I called is "verifyvalue" (lower case as well). But the TestComplete considered that I call a method "VerifyValue" (two "v" are both in upper case), and think the method I called didn't exist. But actually, I didn't call "VerifyValue" (upper case) at all.



  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Kevin,

     


    Can you post here the RuntimeObject node from the Description.xml file where you create the method?


     

  • kkc's avatar
    kkc
    Occasional Contributor

    <RuntimeObject Name="TextBox" Namespace="HTML">

        <Method Name="FillTextBox" Routine="FillTextBox">


            Enter a value in the specified textbox. 


        </Method>


        <Method Name="LookupValue" Routine="LookupValue">


            Click on lookup button and select an item based on value.


        </Method>  


        <Method Name="verifyTextBoxState" Routine="verifyTextBoxState">


             Verify if a Textbox is enabled/disabled. strState: Enabled/Disabled


        </Method>


        <Method Name="TabFromTextBox" Routine="TabFromTextBox">


            Tab from the specified textbox


        </Method>   


        <Method Name="ReadValueFromTextBox" Routine="ReadValueFromTextBox">


            Read a value from the text box and store it in a project variable with the specified name 


        </Method> 


        <Method Name="verifyvalue" Routine="verifyvalue">


            Verify a value in the Textbox


        </Method>        

    </RuntimeObject>