Display results as :

Rechercher Advanced Search

Latest topics
» why do i get this error
Yesterday at 9:43 pm by anbarasi

» wait property
Yesterday at 12:50 pm by anbarasi

» What is the use of Selenium Remote Control
Fri Apr 21, 2017 7:24 pm by azharuddin

» How can I fix it? TCP PORT Exhaustion
Wed Apr 19, 2017 3:29 pm by JohnSnow

» Difference between QTP, Selenium and Silk test
Wed Apr 19, 2017 2:30 pm by Basilios Will

» Locator for google document
Tue Apr 18, 2017 10:01 pm by SergeyK

» I encountered a mistake: Couldn't register this node
Sat Apr 15, 2017 9:06 pm by skyshine725

» Current version tutorial for just creating a browser instance - Visual Studio
Fri Apr 14, 2017 2:47 am by KilpAr

» cant able to select drop down otions
Thu Apr 13, 2017 6:08 pm by anbarasi


getXpathCount returning 0

View previous topic View next topic Go down

getXpathCount returning 0

Post by useroforacle on Tue Aug 31, 2010 4:24 pm

This is my code for finding the row count of a table in a pop up window..I check if the table exists in the pop up window, and it returns me true as well as if a fetch a cell value from the table, then also i am getting a value..but when it try to fetch the row count or column count of the table, it returns value as 0..
What could be the problem..the table exists..but not able to fetch the rowcount..
for (int second = 0;; second++) {
if (second >= 90) fail("timeout");
try { if (selenium.isElementPresent("//html/body/form/div/table/tbody/tr[4]/td/div/div/div/table/tbody/tr[2]/td[2]")){
System.out.println("element present");
String tesstt = selenium.getText("//html/body/form/div/table/tbody/tr[4]/td/div/div/div/table/tbody/tr[2]/td[4]");
System.out.println("tesstt value==>"+tesstt);
if (selenium.isElementPresent("popupFrame"))
System.out.println("Pop up frame selected");
int rowCount=selenium.getXpathCount("//html/body/form/div/table/tbody/tr[4]/td/div/div/div/table/tbody/tr").intValue();

System.out.println("Pop up frame not found");
break; }
catch (Exception e) {
System.out.println("Exception: element not present");


Posts : 1
Join date : 2010-08-31

Back to top Go down

Re: getXpathCount returning 0

Post by freesky on Thu Aug 11, 2011 10:54 am

add Thread.sleep() before getXpathCount


Posts : 72
Join date : 2011-04-13

Back to top Go down

Re: getXpathCount returning 0

Post by mgharikrishnan on Thu Aug 11, 2011 9:06 pm


Try to something like this,

int rowCount = (Integer)selenium.getXpathCount("//table[@id='active-reg']/tbody/tr");
System.out.println("rowCount = "+rowCount);

~ Harri...

Active particpant
Active particpant

Posts : 10
Join date : 2011-06-20

Back to top Go down

Smart solution for Webtables

Post by ashish_techie on Wed Aug 17, 2011 12:39 am

You can use following code

int rowcount=0



System.out.println("Total rows -- "+rowcount);

For selenium training visit:


Posts : 73
Join date : 2011-08-09

Back to top Go down

Re: getXpathCount returning 0

Post by Sponsored content

Sponsored content

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum