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

Enhancements to getting and validating element counts #949

Closed
aaltat opened this issue Oct 7, 2017 · 5 comments
Closed

Enhancements to getting and validating element counts #949

aaltat opened this issue Oct 7, 2017 · 5 comments

Comments

@aaltat
Copy link
Contributor

aaltat commented Oct 7, 2017

  • Deprecate Locator Should Match X Times, Xpath Should Match X Times and Get Matching Xpath Count.
  • Instead Locator Should Match X Times and Xpath Should Match X Times users should use: Page Should Contain Element keyword with limit argument.
  • Instead of Get Matching Xpath Count create Get Matching Locator Count.
@aaltat aaltat added this to the v3.0.0 milestone Oct 7, 2017
@aaltat aaltat self-assigned this Oct 7, 2017
aaltat added a commit to aaltat/SeleniumLibrary that referenced this issue Oct 7, 2017
There was already Locator Should Match X Times which should be used
instead of the Xpath Should Match X Times keyword. Created
Get Matching Locator Count keyword and therefore deprecated
Get Matching Xpath Count keyword.

Fixes robotframework#949
@pekkaklarck
Copy link
Member

As discussed in comments of PR #950, the plan is that Get Matching Locator Count returns an integer, not string. This is different to Get Matching Xpath Count.

aaltat added a commit to aaltat/SeleniumLibrary that referenced this issue Oct 14, 2017
There was already Locator Should Match X Times which should be used
instead of the Xpath Should Match X Times keyword. Created
Get Matching Locator Count keyword and therefore deprecated
Get Matching Xpath Count keyword.

Fixes robotframework#949
@aaltat
Copy link
Contributor Author

aaltat commented Oct 17, 2017

Discussed with Pekka and we did decide the following:

  • Rename Get Matching Locator Count to Get Element Count
  • Deprecate silently also Locator Should Match X Times and enhance Page Should Contain Element to take in optional count argument
  • When Page Should Contain Element keyword count is None it should match to one or more elements. Just like the current keyword works
  • When count is number it should fail if number elements does not match.
  • Optional, count could be also a range, defined like x..y. Where x < y. Keyword should pass if x <= element count <= y

@aaltat
Copy link
Contributor Author

aaltat commented Oct 24, 2017

Decided not to do x..y support in this issue. It is useful feature but, it is more important to get 3.0 rc1 out.

@pekkaklarck
Copy link
Member

The original issue description is outdated and needs to be updated. The title isn't ideal either as it doesn't mention the newly added Get Element Count nor enhancements to Page Should Contain Element. Perhaps the title should be something generic like Enhancements to getting and validating element counts. I reopen this issue until we get at least the misleading description fixed.

@pekkaklarck pekkaklarck reopened this Oct 30, 2017
@aaltat aaltat changed the title Deprecate Xpath Should Match X Times and Get Matching Xpath Count Enhancements to getting and validating element counts Oct 30, 2017
@aaltat
Copy link
Contributor Author

aaltat commented Oct 30, 2017

Fixed title and initial description. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants