Dynamic Web Table handle using selenium :

 

What Is Web Table ?

  • Web Table is made of rows and columns with cell.
  • When we create a table for a web page that is called as a web table.
  • Web tables are basically a set of elements that are stored in logical row and column format.
  • This is used to organize similar information on a web page.
  • In HTML, table is created using <table> tag.

 

Web Table Consist :

  • ’table’ tag defines HTML table.
  • ’tbody’ tag defines a container for rows and columns.
  • ’tr’ defines rows in an HTML table.
  • ’td’/’th’ define the column of an HTML table.

 

Types Of Web Tables :

 

1. Static table:

  • Data is static within cell  i.e. Number of rows and columns are fixed.
  • If there are only one row of the same rows in the web table and the same cell number, whenever you load the page every line.

 

2. Dynamic table:  

  • Data is dynamic within cell  i.e. Number of rows and columns are NOT fixed.
  • When you load the pages of the software web application, the rows and columns of the table are rising / decreasing or some lines have more cells and few lines contain fewer cells.

 

HTML Table Code:

 

Scenarios :

  1. Launch Browser.
  2. Open URL.
  3. Identify table using ID where we want to perform Operation’s.
  4. Read all tr (Table row) and td (Table Data).
  5. Read each and every cell record.
  6. Compare / Verify every Actual cell record with Expected cell.
  7. If found Expected cell within table then Print (“Record is Found…”)

 

Check Cell present or Not in Dynamic WebTable Handle using Selenium:

Dynamic Web Table handle using selenium and Dynamic Web Table handle using selenium and Dynamic Web Table handle using selenium