# Katalon - get the number of rows in excel

**URL:** <https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [September 13, 2019, 2:34pm UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067 "2019-09-13T14:34:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Funkey](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/funkey/32/8068_2.png) [@Funkey](https://forum.katalon.com/u/Funkey)\
**Post date:** [September 13, 2019, 2:34pm UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/1 "2019-09-13T14:34:25Z")

</div>

How do I get the amount of rows from an excel file? Let’s say I have a button and for each row katalon needs to press the button once. How would I do this? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jjunior](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jjunior/32/6633_2.png) [@jjunior](https://forum.katalon.com/u/jjunior)\
**Post date:** [September 13, 2019, 3:09pm UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/2 "2019-09-13T15:09:26Z")

</div>

Hello @Funkey  
Using Test suite approach (like this [video](https://www.youtube.com/watch?v=Nar6Dqdmedk) for example), you will run the test case as many as rows in excel file, that is, in your test case you will have any line that press the button, and the Katalon will run the amount of your excel rows.

I don’t know if its comprehensive

---

<div class="post-metadata">

**Author:** ![Timo\_Kuisma](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Timo\_Kuisma](https://forum.katalon.com/u/Timo_Kuisma)\
**Post date:** [September 14, 2019, 5:21am UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/3 "2019-09-14T05:21:51Z")

</div>

hi,

try to read your excel to list and then will iterate list in your test case

---

<div class="post-metadata">

**Author:** ![discover.selenium](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/discover.selenium/32/522_2.png) [@discover.selenium](https://forum.katalon.com/u/discover.selenium)\
**Post date:** [September 16, 2019, 6:04am UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/4 "2019-09-16T06:04:58Z")

</div>

'The below code will print no of rows in the excel. "  
System.err.println findTestData(‘YourDataFileName’).getRowNumbers()

---

<div class="post-metadata">

**Author:** ![Funkey](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/funkey/32/8068_2.png) [@Funkey](https://forum.katalon.com/u/Funkey)\
**Post date:** [September 16, 2019, 8:54am UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/6 "2019-09-16T08:54:51Z")

</div>

Thanks for the answer exactly what I needed!

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [September 26, 2019, 3:15pm UTC](https://forum.katalon.com/t/katalon-get-the-number-of-rows-in-excel/33067/7 "2019-09-26T15:15:43Z")

</div>


