How to click on button in the table cell

1,969 views
Skip to first unread message

Sree Lakshmi

unread,
Oct 31, 2008, 6:07:52 AM10/31/08
to selenium-users...@googlegroups.com
I have a table which has button name same for all rows, how to click on the button based on row and columns. I have tried using Xpath but it didn't work, giving syntax error. Can anyone please provide syntax.



|| {font:style=color: #ffffff;}*Header 1*{font} || {font:style=color: #ffffff;}*Header 2*{font} ||
| Income | Delete Row(Push Button) |
| Expense | Delete Row(Push Button) |
| Exposure | Delete Row(Push Button) |

satya

unread,
Oct 31, 2008, 6:41:35 AM10/31/08
to selenium-users...@googlegroups.com
{quote}
Hi Srilakshmi,
Use the Xpath to get to that elememt..I mean table cell..
I think in your Case...
selenium.click("xpath=//table[@id='tableid']/tr[2]/td[2])" for first push button..
if the table has an ID..if not use the Xpath Checker to get the Xpath for your cell..

I think that will help you..if you need any more info just let me know..
Thanks
Satya

Sree Lakshmi

unread,
Oct 31, 2008, 6:58:10 AM10/31/08
to selenium-users...@googlegroups.com
i have used firefox xpather and find the path as follows:
   table[@id='table1']/tbody/tr[2]/td[4]/input

but when i tried the same in IE it didn't worked. :-(

Thanks

Sree Lakshmi

unread,
Oct 31, 2008, 7:00:12 AM10/31/08
to selenium-users...@googlegroups.com
Hi Sathya,
I have used "xpath=//table[@id='tableid']/tr[2]/td[4]" it saying Element not found.

thanks

satya

unread,
Oct 31, 2008, 8:22:09 AM10/31/08
to selenium-users...@googlegroups.com
Hi Sreelakshmi,
Have you tried it in Firefox...I think there is a problem wit xpath on IE..i am testing my application only on firefox at the moment..try it on fire fox  if that does not work let me know..
i think in IE you can use developer toolbar similar to fiebug ...

Thanks
Satya

Sree Lakshmi

unread,
Nov 3, 2008, 4:00:37 AM11/3/08
to selenium-users...@googlegroups.com
Final working stmt is browser.click("xpath=//table[@id='table1']/tbody/tr["+row+"]/td["+col+"]/input");

thanks for all.

Reply all
Reply to author
Forward
0 new messages