Home - gsumit1/TruePath GitHub Wiki

TruePath dynamically generates relative XPath on right click on a web page and display all the XPath as the menu items.

TruePath helps you in the creation of Dynamic XPath, Relative XPath, Unique XPath as well as Index XPath.

TruePath creates XPath in iFrame or XPath from Frame along with an indicator, that the created XPath is from Frame or iFrame. It also shows up the iFrame and iFrame URL so that user can quickly identify that from which iFrame or Frame the XPath is generated.

This XPath Plugin also has the capability to generate the XPath using text value.

Since it supports normal XPath and Page Object XPath format i.e., @FindBy, it can easily be used as Selenium locater, Selenium Page Object locater or Serenity Page Object locater.

It has built-in intelligence that if the element has long, auto-generated attributes such as id="abc123_ElementContains_Inputs_txtName" it will attempt to locate based on the final (and most significant) part of the value only.

For Firefox version < 56: It then group the XPath as follows:

  1. XPath with id, href, src: This group will list all XPath which has the id, href, src or any http\ https as the attribute.
  2. XPath with class, name, title: This group will list all XPath except those containing id, href, src or any http\ https.
  3. XPath with index: As the name suggests this group will contain all indexed XPath.

For Firefox version > 55: It then group the XPath as follows:

  1. Green thumbs up: This group will list all XPath except those containing id, href, src or any http\ https.
  2. Yellow thumbs up: This group will list all XPath which has id, href, src or any http\ https as the attribute.
  3. Red thumbs up: This group will contain all indexed XPath.

Sometimes the attributes id, src, href etc. contains auto-generated values that's why grouping them under yellow thumbs. Indexed XPath is kept in Red Thumbs-up the group as they are vulnerable to the frequent UI changes. The automation tester can use this XPath from these two groups, depending upon the understanding of the web page(AUT).

For Issues: https://github.com/gsumit1/TruePath/issues