diff --git a/docs/tips-tricks.md b/docs/tips-tricks.md index edc1d57bd..4f7539c6d 100644 --- a/docs/tips-tricks.md +++ b/docs/tips-tricks.md @@ -345,33 +345,6 @@ BAD: ``` -### Build selectors with appropriate specificity - -Selectors that are too general might sweep up unexpected elements. -When possible, select the first parent tag and then specify the desired element within that selection. - -**Why?** Elements that are overly specific are less flexible and may fail if unexpected DOM changes occur. It also reduces the amount of the DOM it needs to parse. - - -GOOD: - - -```html - form[name='myform'] > input[name='firstname'] - - //*[@id='container'][@class='dashboard-title'] - ``` - - -BAD: - - -```html - input[name='firstname'] - - //*[@id='container']/*[@class='dashboard-advanced-reports']/*[@class='dashboard-advanced- reports-description']/*[@class='dashboard-title'] - ``` - ## General tips ### Use data references to avoid hardcoded values