New WebElements.AssertCount(min, max)/AssertUnique methods #26
Replies: 1 comment 1 reply
-
@6DiegoDiego9, sounds good to me. As I have said in previous correspondence, the development of this project has exceeded my need, interest, and skillset. So I'm thinking to invite you as a co-collaborator which (I think) will give you the ability to accept your own pull requests, as well as to manage others, and to continue developing the project. I'll stay on as a collaborator in case you disappear for any reason, but I intend to curtail my involvement... What do you think? I will contribute one more pull soon having to do with a cleanup of the dropdown option select methods, and adding GetParentElement, GetChildElements, and TableToArray methods to WebDriver and WebElement classes. After that pull, I will send you the co-collaboration invite that you can accept if you are interested. So please hold off on adding your assert methods until then... Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
One thing that I never accepted in my Selenium web scraping scripts is the blind trust of taking the "first occurrence" with all the FindElement methods.
I always use a wrapper function in a public method that also verifies that the occurrence is unique, evaluating the importance of this easy check higher than the negligible overhead (0.00* sec in my few tests) of parsing all the DOM (using the correspondent FindElements) instead than exiting at the first found occurrence.
Furthermore, even when I want a collection with FindElements I usually verify that the number of occurrences returned are equal to a number or between two numbers.
I think that it would be convenient to incorporate these methods into SeleniumVBA, in the WebElements class, like in this examples:
What do you think?
Suggestions?
What about also supporting 0 as AssertCount minimum so that for example AssertCount(0,3) or AssertCount(,3) works and returns Nothing in case of 0 occurrences?
Beta Was this translation helpful? Give feedback.
All reactions