Your test should mimic how it is going to be used. If you are testing UI, you want to test by clicking buttons, inputting values in fields etc. You also want to test accessibility, so you should use parameters that are commonly used by accessibility devices for finding elements on the page.