0

Pagination is itself a last row of table "ContentPlaceHolder1_gvChannelList". I want to count the number of pages/number of columns in pagination table.

driver.findElements(By.id("//*[@id='ContentPlaceHolder1_gvChannelList']/tbody/tr[17]/td/table/tbody/tr/td")).size()

Is returning 0 though there are five columns/<td> tags.

html table element hierarchy

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
user3563618
  • 1
  • 1
  • 1

1 Answers1

1

You are searching by Id, but you gave xpath expression. Try

driver.findElements(By.xpath("//*[@id='ContentPlaceHolder1_gvChannelList']/tbody/tr[17]/td/table/tbody/tr/td")).size()
Guy
  • 46,488
  • 10
  • 44
  • 88