From 686f052859b158ad79b1e93742688b3d93661dce Mon Sep 17 00:00:00 2001 From: Adarsh Manickam Date: Sat, 14 Dec 2019 18:24:15 +0530 Subject: [PATCH 1/3] Added clarity in selector paths --- docs/guides/selectors.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/guides/selectors.md b/docs/guides/selectors.md index 3e019bb75..35a96d29f 100644 --- a/docs/guides/selectors.md +++ b/docs/guides/selectors.md @@ -208,7 +208,7 @@ Here is an example of what NOT to do, but this demonstrates how the selector wor In the BAD example above, we are specifying a very precise path to an input element in the DOM, starting from the very top of the document. -Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM. +Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM starting from the element preceedingly defined. If no element is defined before, the entire DOM is searched. Example: @@ -216,6 +216,8 @@ Example: //div[@class=’form-group’]//input[@id='user-message'] ``` +In the GOOD example above, all
elements in the DOM are matched first, and then all with
as one of its parents is matched. Doesn't matter if the parent is anywhere up in the parent hierarchy. + #### Parent Selectors The parent selector (`..`) allows you to jump to the parent element. From 0e0a514273b2164d4e47997dd9f160403211d44b Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Fri, 20 Dec 2019 09:07:53 -0600 Subject: [PATCH 2/3] Added clarity in selector paths - Code review --- docs/guides/selectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/selectors.md b/docs/guides/selectors.md index 35a96d29f..e060ba6c4 100644 --- a/docs/guides/selectors.md +++ b/docs/guides/selectors.md @@ -216,7 +216,7 @@ Example: //div[@class=’form-group’]//input[@id='user-message'] ``` -In the GOOD example above, all
elements in the DOM are matched first, and then all with
as one of its parents is matched. Doesn't matter if the parent is anywhere up in the parent hierarchy. +In the `GOOD` example above, all `
` elements in the DOM are matched first, and then all `` with `
` as one of its parents is matched. The parent does not have to immediately precede it since it uses another double forward slash `//`. #### Parent Selectors From 96b724983ec0108c815609659449a4c9af7cbc5f Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Thu, 2 Jan 2020 09:59:00 -0600 Subject: [PATCH 3/3] Grammar fixes --- docs/guides/selectors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/selectors.md b/docs/guides/selectors.md index e060ba6c4..d1441865a 100644 --- a/docs/guides/selectors.md +++ b/docs/guides/selectors.md @@ -208,7 +208,7 @@ Here is an example of what NOT to do, but this demonstrates how the selector wor In the BAD example above, we are specifying a very precise path to an input element in the DOM, starting from the very top of the document. -Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM starting from the element preceedingly defined. If no element is defined before, the entire DOM is searched. +Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM starting from the specified element. If no element is defined, the entire DOM is searched. Example: @@ -216,7 +216,7 @@ Example: //div[@class=’form-group’]//input[@id='user-message'] ``` -In the `GOOD` example above, all `
` elements in the DOM are matched first, and then all `` with `
` as one of its parents is matched. The parent does not have to immediately precede it since it uses another double forward slash `//`. +In the `GOOD` example above, all `
` elements in the DOM are matched first. Then all `` with `
` as one of its parents are matched. The parent does not have to immediately precede it since it uses another double forward slash `//`. #### Parent Selectors