Forum Discussion
you can try
Obj.Keys("^aMyText")
so all text is selected (^a) and replaced withy "MyText"
Or Obj.SetText("MyText")
I would go with one of the methods that selects all and/or deletes/overwrites the text, and uses keys.
Personally, I think using methods such as "Clear" and "Value" and "SetText" are all bad. Reason being, your automated test is supposed to simulate a user. The user cannot invoke any of these methods. If you use them in your automated test, you are potentially going to miss defects as you are not using the application in the same way the user does.
Also, using these methods may not activate event triggers which should activate when "Keys" is used.
Thats my take on it anyway. Always emulate the user. Don't use methods the user can't get to just because it makes life easier. Thats not a proper test.