Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

In a Selenium Junit test, for a table with 'n' rows in a dialog box of a webpage, I am able to calculate number of rows using Table.size() (Table is a List of elements which finds elements with tag tr) The problem is the size() gives all rows (n rows) in the table. How do I calculate rows which are seen only on the view (having height of 'x'px)(I am able to calculate the height of table and rows though )

share|improve this question

2 Answers 2

Do the elements have a VisibleOnScreen property?

Or if you have access to the height property you can delete from the list the ones that don't matter...

I'm just fishing here, never used it before...

share|improve this answer

The height is calculated using getCssValue("height") property. I am not sure if it is the correct way to limit the count or is there any function which can limit rows? I am able to use table.size() to get the count of the rows which includes rows in the dialogbox (after scrolling down the dialog) whereas I want rows only screen on top without scrolling.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.