Flaky Locator

Definition:

  • A key component to making UI automation work is to provide your tool with identifiers to the elements that you’d like it to find and interact with. Using flaky locators—ones that are not durable—is an awful code smell.

Code Example:

/html/body/div/div/div/div/div[2]/label/span[2]

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring