Forum Discussion

sbkeenan's avatar
sbkeenan
Frequent Contributor
11 years ago

JScript vs VBScript

Hi all I've been using TestComplete for a few years now and have been writing scripted tests in VBScript and have to say that I've never encountered any problems with doing so (at least no issu...
  • simon_glet's avatar
    11 years ago
    Hi Stephen,



    This is interesting... I never ran into your issue because all our application (VS C++) elements that respond to wText return a String.



    With the following test code:



    function someString() {

      this.type = "someString";

    }


    someString.prototype.getString = function (){

        return new Object("aString for class " + this.type);

      }



    function TestStringVar()

    {

      var aStringObject = new someString();

      var anObject = new Object("someOtherString");

     

      Log.Message(aStringObject.getString()); 

      Log.Message(aStringObject.getString().toLowerCase()); 

      Log.Message(aStringObject.toString());

     

      // This raises the exception that triggered this thread

      //Log.Message(aStringObject.toLowerCase());

      

      Log.Message(anObject.toLowerCase()); 

      Log.Message(anObject.toString());

      Log.Message(anObject);

     

    }



    And with your code, I can reasonnably assume that if textBox.wText.toLowerCase() doesn't work, textBox.wText.toString().toLowerCase() will.



    Sincerely