This old post Selenium Testing Best Practices describes the problem that the id values generated by the Force.com platform on default (layout-based) UI fields vary between orgs. So the normal practice of using field ids to match page elements to stop Selenium tests being fragile (when elements are added or removed) looks impractical unless you can guarantee to only ever need to test in one org.
Can anyone offer advice on how to work around this problem?
PS I think I need to clarify the issue here. The question is not about how to use locators (or similar) in Selenium. The question is about how to insulate Selenium tests from id changes between orgs. If you use Chrome's "Inspect Element" on a default (layout-based) UI field you will see that id values such as "CF00Nd0000005XJ71" appear. Install or deploy to a different org and that id value will have changed. I'm looking for anyone who has actually confronted this problem to share their approach to it e.g. matching other items in the pages or finding some way to abstract out the id values and use more meaningful keys in the Selenium tests.