Hi Surachart,
Mendix did build in functionality to support test tools check out this page for more information. As you can read on there the div that is wrapped around both the label and input field is marked with a class that is the name of the input field in your modeler prefixed by mx-name-. This should help you to automatically select the input box from your test tool