Forum Discussion

helenahellberg's avatar
helenahellberg
New Contributor
14 years ago

Object-ID's in browser change name

Object-ID's in browser change name for the property Name and FullName if the name include '-'



For example: 438F20D4-641A-4D9A-A5E8-688B1985F306_panel change to 438F20D4_641A_4D9A_A5E8_688B1985F306_panel



Why is this and are there anymore of these changes?



Thanks & Best Regards

//Helena H
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Well, those two items are actually exactly the same as you have posted so I'm assuming that this was a mistake in a copy and paste.



    However, certain types of objects built by the browser have an ID that will change each time it is created.  This is normal.  TestComplete simply reports back what is present on the object.



    My best suggestion is for you to try some of the techniques indicated in the following screencast.



    http://smartbear.com/support/screencasts/testcomplete/reliable-tests-for-dynamic-objects/
  • Those two items are not the same to me, I want to be able to see the difference between '-' and '_'



    438F20D4-641A-4D9A-A5E8-688B1985F306_panel

    438F20D4_641A_4D9A_A5E8_688B1985F306_panel



    I am aware that certain types of objects have dynamic ID's, but this is not the problem here.



    My question is: Why does TestComplete convert '-' into '_' for Name and FullName, since I see in the developed SW-code that the string is created with '-'?



    Best Regards

    //Helena H
  • Helena,


    Perhaps, these names can be used in test scripts. In this case, they cannot contain the "-" characters. If they contained them, it would be a syntax error.

  • Hi!



    Thanks! So... you could say that '-' is a non-supported character, are there anymore of this kind that cant be used for naming objects?



    BR

    //Helena
  • Helena,


    TestComplete supports several scripting languages. To make object names compatible with the rules that are used in all these languages (they are slightly different), we follow this simple concept: a name may contain only alphanumeric characters (a..z, A..Z, 0..9)  and underscores ( _ ), and must start with a letter (a..z, A..Z).


    According to this rule, TestComplete, for instance, "replaces" .NET method names started with an underscore (like _cstor) with zctor(). Otherwise, using these methods in VBScript code would cause a syntax error.