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

Implement Table methods #8

Open
titusfortner opened this issue Aug 15, 2018 · 4 comments
Open

Implement Table methods #8

titusfortner opened this issue Aug 15, 2018 · 4 comments

Comments

@titusfortner
Copy link
Owner

Things like Table#hashes are very wire call intensive for typically static elements.

A number of Table related methods can be optimized using Watigiri.

@kapoorlakshya
Copy link

Do you have any examples of such methods? Just curious.

@titusfortner
Copy link
Owner Author

#strings - https://github.com/watir/watir/blob/master/lib/watir/row_container.rb#L26
#hashes - https://github.com/watir/watir/blob/master/lib/watir/elements/table.rb#L28
#headers - https://github.com/watir/watir/blob/master/lib/watir/elements/table.rb#L44
#column_header - https://github.com/watir/watir/blob/master/lib/watir/elements/table_cell.rb#L4
#siblings_from_header - https://github.com/watir/watir/blob/master/lib/watir/elements/table_cell.rb#L9

The biggest sticking point here is that there are a lot of different ways that tables can be formatted. What is displayed on the page is not necessarily in the order that it is written in the html due to <thead> and <tfoot> and <tbody> tags, all of which are optional. <th> and <tr> tags are both options for things as well...

Watir gets around this by querying and sorting on the cellIndex attribute of each tr, which is not present when we do an getInnerHtml call for watigiri. I'm not certain the best way around this, other than some complicated brute forcing and/or making assumptions and giving a YMMV disclaimer.

@titusfortner
Copy link
Owner Author

Actually I think #column_header & #siblings_from_header are straightforward now. #hashes & #strings are a crazy number of wire calls.

@kapoorlakshya
Copy link

Makes sense. Thanks!

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

No branches or pull requests

2 participants