From 62bdb2c867b66a2db56dd20d03ed4119e2ae89ef Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 29 Jul 2019 10:55:03 -0500 Subject: [PATCH] MQE-1675: Remove 'Build selectors with appropriate specificity' from devdocs --- docs/tips-tricks.md | 27 --------------------------- 1 file changed, 27 deletions(-) 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