Forum Discussion

kandy1984's avatar
kandy1984
Contributor
12 years ago

how to assign custom name to txtbox?

Hi,



I have a brand new screen comming along in developement and there is a text box on the screen which its position may change in the next comming builds.When i record a new test, the text box is regonised by its position on the screen. How can i ask testcomplete to regonise it by a name or something else? so that in the future if the position of the text box is changed then i do not need to redo the keyword test.
  • In your image, you can see that the user clicked at position 119,5 of the txtFilter object.



    If the name of the txtFilter is not changing, then those coordinates will lie within it regardless of its position on the screen, assuming it didn't change size.



    If the control will be changing size, then try changing the numbers to something that will always be within the smallest possible size. (You can change those numbers manually by double clicking the line item in your keyword test... try position 5,5 or something)



    If the control changes names, then it would be more complicated, but you could use a code statement to search it down as a child of an object that doesn't change names...