recheck-web
recheck-web copied to clipboard
Path attribute should follow common format
Paths currently have the following form:
HTML[1]/BODY[1]/A[1]
The path represents the absolute XPath to the corresponding element. According to the XPath specification:
An absolute location path consists of
/
optionally followed by a relative location path.
Moreover, although the HTML specification says that "tag names are case-insensitive", they typically only consist of lower-case letters.
Therefore, we should start with /
and use lower-case letters:
/html[1]/body[1]/a[1]
We filter out the path separator here at the beginning of the method. Changing this method could lead to many problems that are not directly apparent. We should discuss that. @beatngu13 @roesslerj
Lowercase migrator merged in https://github.com/retest/recheck/pull/180. However, this doesn't address e.g. the leading slash. We should also think about enforcing our desired format in Path
.
What I also realized and I think this is related: When copying a XPath from Chrome, one gets something like:
/html/body/div[2]
That is, [1]
is omitted, so I think it should be optional in our XPath too.