Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path attribute should follow common format #132

Open
beatngu13 opened this issue Dec 18, 2018 · 3 comments
Open

Path attribute should follow common format #132

beatngu13 opened this issue Dec 18, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@beatngu13
Copy link
Contributor

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]
@beatngu13 beatngu13 added the enhancement New feature or request label Dec 18, 2018
@enesoezel enesoezel self-assigned this Jan 24, 2019
@enesoezel
Copy link
Contributor

enesoezel commented Jan 29, 2019

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

@beatngu13
Copy link
Contributor Author

beatngu13 commented Apr 24, 2019

Lowercase migrator merged in retest/recheck#180. However, this doesn't address e.g. the leading slash. We should also think about enforcing our desired format in Path.

@beatngu13
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants