# How to go last row of the webtable using robot framework

**URL:** https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369
**Category:** SeleniumLibrary
**Created:** [14 June 2020 14:55 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369 "2020-06-14T14:55:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![adskul](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@adskul](https://forum.robotframework.org/u/adskul)
#### Post date: [14 June 2020 14:55 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/1 "2020-06-14T14:55:01Z")

</div>

Hi,  
I want to click on last row of a web table.  
How to locate it automatically without putting its xpath manually?

---

<div class="post-metadata">

### Author: ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)
#### Post date: [14 June 2020 16:56 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/2 "2020-06-14T16:56:19Z")

</div>

Hi,

you could get all elements of the table with an css or xpath that finds all and the click on the last one.

```python
${all_elements} Get WebElements xpath://what/ever/you/need
Click Element ${all_elements}[-1]

```

---

<div class="post-metadata">

### Author: ![adskul](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@adskul](https://forum.robotframework.org/u/adskul)
#### Post date: [15 June 2020 08:43 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/4 "2020-06-15T08:43:04Z")

</div>

Hi,  
Thanks!  
Below was working for me but after sometime it started giving few error.

```python
${Value} Get Table Cell xpath=//*[@id="tableData"] ${rows+1} 10     

```

log to console Value in mentioned cell is ${Value}  
I changed to it;

```python
${Value} Get Text l xpath=//*[@id="tableData"] /tbody/tr[${rows}]/td[1]

```

---

<div class="post-metadata">

### Author: ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)
#### Post date: [15 June 2020 10:57 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/5 "2020-06-15T10:57:57Z")

</div>

You said that you want to click on the last row.  
If it works also that you can click on a specific cell, and it is a real html table,  
you could go for `Get Table Cell`

```python
${last_row_cell} Get Table Cell xpath=//*[@id="tableData"] -1 1
Click Element ${last_row_cell}

```

I do not understand why now `Get Text` is used and where ${rows} is coming from but ok.

---

<div class="post-metadata">

### Author: ![adskul](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@adskul](https://forum.robotframework.org/u/adskul)
#### Post date: [15 June 2020 11:37 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/6 "2020-06-15T11:37:28Z")

</div>

Ya, I got that.

Thanks !

---

<div class="post-metadata">

### Author: ![adskul](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@adskul](https://forum.robotframework.org/u/adskul)
#### Post date: [15 June 2020 11:40 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/7 "2020-06-15T11:40:10Z")

</div>

I am facing another issue in file import in python modal pop up where there is no ‘input’ tag and hence I am not able to use choose file. I use **auotit library** but it’s working is fluctuating manner. sometime It uploads file and sometime it gives as file name is not valid after file explorer opens and in file name field my file path appears and clicks on open.

---

<div class="post-metadata">

### Author: ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)
#### Post date: [15 June 2020 21:49 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/8 "2020-06-15T21:49:52Z")

</div>

Yes i saw this othe rthread but can not help with this. Sorry!

Please do not cross post this stuff.

---

<div class="post-metadata">

### Author: ![adskul](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@adskul](https://forum.robotframework.org/u/adskul)
#### Post date: [16 June 2020 05:40 UTC](https://forum.robotframework.org/t/how-to-go-last-row-of-the-webtable-using-robot-framework/369/9 "2020-06-16T05:40:12Z")

</div>

@René Thanks !
