<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.craftoftesting.com/index.php?action=history&amp;feed=atom&amp;title=Reference_-_XPath_and_Locators</id>
	<title>Reference - XPath and Locators - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.craftoftesting.com/index.php?action=history&amp;feed=atom&amp;title=Reference_-_XPath_and_Locators"/>
	<link rel="alternate" type="text/html" href="https://wiki.craftoftesting.com/index.php?title=Reference_-_XPath_and_Locators&amp;action=history"/>
	<updated>2026-10-15T17:21:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.craftoftesting.com/index.php?title=Reference_-_XPath_and_Locators&amp;diff=92&amp;oldid=prev</id>
		<title>Gregpaskal: Created page with &quot;{{: Header_Nav}} 931x931px   &#039;&#039;&#039;XPath Locator Fundamentals&#039;&#039;&#039;  The following are Best Practice XPath models to be used in object location for automated testing. A few fundamental rules to apply when setting up object locators.  # Tune XPath locators using Chrome browser and Developer Tools. Craft minimum number of attributes necessary to reliably locate an object, typically 1 HTML Tag and 1 Attribute Tag are all that’s needed. # Locat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.craftoftesting.com/index.php?title=Reference_-_XPath_and_Locators&amp;diff=92&amp;oldid=prev"/>
		<updated>2025-04-05T03:46:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{: Header_Nav}} &lt;a href=&quot;/index.php?title=File:HTMLAnatomy.png&quot; title=&quot;File:HTMLAnatomy.png&quot;&gt;frameless|931x931px&lt;/a&gt;   &amp;#039;&amp;#039;&amp;#039;XPath Locator Fundamentals&amp;#039;&amp;#039;&amp;#039;  The following are Best Practice XPath models to be used in object location for automated testing. A few fundamental rules to apply when setting up object locators.  # Tune XPath locators using Chrome browser and Developer Tools. Craft minimum number of attributes necessary to reliably locate an object, typically 1 HTML Tag and 1 Attribute Tag are all that’s needed. # Locat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{: Header_Nav}}&lt;br /&gt;
[[File:HTMLAnatomy.png|frameless|931x931px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;XPath Locator Fundamentals&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The following are Best Practice XPath models to be used in object location for automated testing. A few fundamental rules to apply when setting up object locators.&lt;br /&gt;
&lt;br /&gt;
# Tune XPath locators using Chrome browser and Developer Tools. Craft minimum number of attributes necessary to reliably locate an object, typically 1 HTML Tag and 1 Attribute Tag are all that’s needed.&lt;br /&gt;
# Locators should typically begin with an HTML Tag followed by an Attribute Tag such as ID or Name.&lt;br /&gt;
# Error on the side of data-testid, id or Name attributes as these tend not to change as often when an application goes through look-and-feel changes.&lt;br /&gt;
# Avoid using Class or other look-and-feel attributes in XPath locators as these are most likely to change over time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |Most to Least Desirable Locator Attributes&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Multi&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;XPath&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;HTML Sample&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;data-testid&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//input[@data-testid=&amp;#039;TransferAmount&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//button[@id=&amp;#039;ChangePasswordForm_save&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//input[@value=&amp;#039;Get the Free Guide!&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//button[@class=&amp;#039;ResetBudget&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//input[@type=&amp;#039;password&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;contains(text)&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//div[contains(text(), &amp;#039;Transactions&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;name()&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[name()=&amp;#039;svg&amp;#039; and @class=&amp;#039;ct-chart-line&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |XPath Best Practice Examples&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Multi&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;XPath&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;HTML Sample&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Page containing Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[text()=&amp;#039;Start free trial&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Page containing Text with escaped apostrophe&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[text()=&amp;#039;Don\&amp;#039;t remember it? No problem,&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Header containing Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//h1[contains(text(),&amp;#039;Dashboard&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Header containing Text (normalized)&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//h6[normalize-space()=&amp;#039;My Timesheets&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;h6 class=&amp;quot;abc123&amp;quot;&amp;gt;My Timesheets&amp;lt;/h6&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Anchor containing Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//a[contains(text(),&amp;#039;Remove&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;a href=&amp;quot;www.someurl.com&amp;quot;&amp;gt;Remove&amp;lt;/a&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Anchor containing href&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//a[contains(@href,&amp;#039;/report/admin/advisors/&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;a href=&amp;quot;/report/admin/advisor&amp;quot;&amp;gt;5417 QA&amp;lt;/a&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Anchor with class&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//a[@class=&amp;#039;AppBadges&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;a class=&amp;quot;AppBadges&amp;quot; href=&amp;quot;https://itunes.apple.com&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Button with ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//button[@id=&amp;#039;company_advisor&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;button id=&amp;quot;company_advisor&amp;quot;&amp;gt;Add Advisor&amp;lt;/button&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Button containing Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//button[contains(text(),&amp;#039;Create My Account&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;button type=&amp;quot;button&amp;quot;&amp;gt;Create My Account&amp;lt;/button&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Span containing Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//span[contains(text(),&amp;#039;Next&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Input with Name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//input[@name=&amp;#039;firstName&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Input with Value, Indexed&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;(//input[@value=&amp;#039;View Details&amp;#039;])[2]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Select with Name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//select[@name=&amp;#039;country&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;select name=&amp;quot;country&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Select with ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//select[@id=&amp;#039;salesforce_web_lead&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;select id=&amp;quot;salesforce_web_lead&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Textarea with ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//textarea[@id=&amp;#039;salesforce_web_lead_description&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Span with Class containing specific text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//span[@class=&amp;#039;card-title&amp;#039;][contains(text(),&amp;#039;Income&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;card-title&amp;quot;&amp;gt;Income&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Named element with class&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[name()=&amp;#039;svg&amp;#039; and @class=&amp;#039;ct-chart-line&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;svg xmlns:ct=&amp;quot;&amp;lt;nowiki&amp;gt;http://www.github.com/chartist-js/ct&amp;lt;/nowiki&amp;gt;&amp;quot; class=&amp;quot;ct-chart-line&amp;quot;&amp;gt;&amp;lt;/svg&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Named element with attribute&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;line = //*[name()=&amp;#039;line&amp;#039; and @y1=&amp;#039;213&amp;#039;]&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;line y1=&amp;quot;213&amp;quot; y2=&amp;quot;213&amp;quot; x1=&amp;quot;50&amp;quot; x2=&amp;quot;544.453125&amp;quot; class=&amp;quot;ct-grid ct-vertical&amp;quot;&amp;gt;&amp;lt;/line&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Section with class name &amp;amp; Span containing text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//section[@class=&amp;#039;HeroRow&amp;#039;]//span[contains(text(),&amp;#039;Live&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;section class=&amp;quot;HeroRow&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&amp;quot;HeroRow-wrapper&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;     &amp;lt;nowiki&amp;gt;&amp;lt;h1 class=&amp;quot;HeroRow-header&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;        &amp;lt;nowiki&amp;gt;&amp;lt;span style=&amp;quot;white&amp;quot;&amp;gt;Live&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Sibling and value&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//h2[contains(text(),&amp;#039;Profit&amp;#039;)]/following-sibling::progress[@value=&amp;#039;100&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;h2 class=&amp;quot;gzl-Heading&amp;quot;&amp;gt;Profit&amp;lt;/h2&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;  &amp;lt;progress class=&amp;quot;ResultsGraph&amp;quot; value=&amp;quot;100&amp;quot;&amp;gt;&amp;lt;/progress&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Element and value&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//h3[(@class=&amp;#039;desserts&amp;#039;) and (contains(text(),&amp;#039;Cookie&amp;#039;))]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;h3 class=&amp;quot;desserts&amp;quot;&amp;gt;Cookie&amp;lt;/h3&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;iFrame containing text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//iframe[contains(@src,&amp;#039;cardNumber&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;iframe src=&amp;quot;https://js.stripe.com/card.html[color]=%23CFD7E0;componentName=cardNumber;&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |XPath Brittle Examples&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Multi&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;XPath&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;HTML Sample&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;The XPath will match any input on the page containing the word Save and is not precise enough.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//input[@value=&amp;#039;Save&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Matches any input containing &amp;quot;Save&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;This XPath provides no clues to what it actually references. The nesting of 3 div tags, anchor tags and a span make this extremely unintuitive and brittle.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;.//*[@id=&amp;#039;main&amp;#039;]/section/div[3]/a/span&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Brittle and unintuitive&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Another overly nested XPath that provides no clue to what it actually references.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;.//*[@id=&amp;#039;main&amp;#039;]/section/div[2]/div[2]/a/span&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Brittle and unintuitive&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Another overly nested XPath that provides no clue to what it actually references.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;.//*[@id=&amp;#039;main_navigation&amp;#039;]/ol[2]/li[2]/a&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Brittle and unintuitive&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Another overly nested XPath that provides no clue to what it actually references.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//table[@id=&amp;#039;:if&amp;#039;]//tbody[1]//tr[1]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Brittle and unintuitive&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;The XPath must match this entire string to pass. Unless this exact string is required, this text should be trimmed down to a much smaller sample.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[text()=&amp;#039;Your email is already in use. Simply enter your existing password below.&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Excessively long and brittle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;This XPath should probably only contain the H2 tag and ID which would be queried to determine if &amp;quot;Firms&amp;quot; existed within it.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//h2[@id=&amp;#039;page_title&amp;#039;][contains(text(), &amp;quot;Firms&amp;quot;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Excessive locators&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;The iFrame should be referenced by name or ID if possible. This may be acceptable in certain scenarios. Talk to Dev about adding naming to make this better testable.&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//iframe[@tabindex=&amp;#039;-1&amp;#039;]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;Exclusively referenced by Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |XPath Special Examples&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Multi&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;XPath&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;HTML Sample&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;Entire HTML Source Code&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;/html&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;HTML Body Source Code&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;/html/body&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All Links&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//a&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All JPG Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img[contains(@src,&amp;#039;.jpg&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All JPG Images (alt 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//*[contains(@src,&amp;#039;.jpg&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All GIF Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img[contains(@src,&amp;#039;.gif&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All PNG Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img[contains(@src,&amp;#039;.png&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All SVG Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img[contains(@src,&amp;#039;.svg&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;img src=&amp;quot;https://cdn.paskalfamily.com/footer-logo.svg&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;code&amp;gt;All JPG or PNG Images&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;{xpath: &amp;quot;//img[contains(@src,&amp;#039;.jpg&amp;#039;) or contains(@src,&amp;#039;.png&amp;#039;)]&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Locator Naming Convention and Abbreviations&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Abbreviation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;BUT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_BUT_SEARCH = { xpath: &amp;quot;//input[@value=&amp;#039;Search&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Checkbox&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;CBX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_CBX_TERMS_AND_CONDITIONS = { xpath: &amp;quot;//input[@id=&amp;#039;termsAccepted&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Dialog Box&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DIA&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_DIA_ORDER_CONFIRMED&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Dropdown List&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;DPD&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_DPD_STATE = { xpath: &amp;quot;//select[@id=&amp;#039;state&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Edit Box&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;EDT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_EDT_WEIGHT = { xpath: &amp;quot;//input[@name=&amp;#039;weight&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Edit Textarea&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;ETX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_ETX_DETAILS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;iFrame&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;IFRAME&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_IFRAME_STRIPE = { xpath: &amp;quot;//iframe[contains(@data-src, &amp;#039;stripe&amp;#039;)]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;IMG&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_IMG_GOOGLE = { xpath: &amp;quot;//img[@id=&amp;#039;hplogo&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Hyperlink&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LNK&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_LNK_AMAZON = { xpath: &amp;quot;//a[@id=&amp;#039;amazonOrder&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Menu&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;MNU&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_MNU_MAIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Menu Item&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;MUI&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_MUI_PRIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Radio Button&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;RDO&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_RDO_SHIPPING = { xpath: &amp;quot;//label[@for=&amp;#039;shipping_ups&amp;#039;]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;TXT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_TXT_DESCRIPTION = { xpath: &amp;quot;//h2[contains(text(), &amp;#039;This Texas BBQ is one of the best&amp;#039;)]&amp;quot; }.freeze&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Toolbar&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;BAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_BAR_TOOLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Window&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;WIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;LO_WIN_SETTINGS&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== XPath Learning and References: ==&lt;br /&gt;
XPath Tutorial - https://www.w3schools.com/xml/xpath_intro.asp&lt;br /&gt;
&lt;br /&gt;
XPath Syntax Details - https://www.w3schools.com/xml/xpath_syntax.asp&lt;br /&gt;
&lt;br /&gt;
Online XPath Experimentation Tool - http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm&lt;br /&gt;
&lt;br /&gt;
Another xPath Cheatsheet - https://devhints.io/xpath&lt;/div&gt;</summary>
		<author><name>Gregpaskal</name></author>
	</entry>
</feed>