Ask a Question

Web Table

Ilakkk
Occasional Contributor

Web Table

Hi Team, I want to print the table in table format while in Log, but it prints like a single line all the table values. It's hard-to-understand table content so I want to print like table in Log. Is it possible to print like that??? 

Can anyone help me regarding this

 

 

 

Many Thanks in Advance.

6 REPLIES 6
Ilakkk
Occasional Contributor

Hi all, I have tried and display only the row values and for cell values Error: cannot read property cells of null What mistake I have did here Let me know

 

IMG_20221128_135438 (1).jpgIMG_20221128_135416 (1).jpg

rraghvani
Valued Contributor

This option allows you to insert coding, make use of it.

rraghvani_0-1669627005103.png

If you want to capture images, then use the Snipping Tool. 

rraghvani_1-1669627071288.png

You don't need to take photographs of your screen!

rraghvani
Valued Contributor

TC Log can only show the output of items as plain list or tree node folders, which include test log items.

 

 

Ilakkk
Occasional Contributor

Hi rraghvani,Thanks for your response, then how can I print the values APY values, which I have previously shared. It shows that error know cell value is null

 

ilakkia_0-1669628811746.png

 

rraghvani
Valued Contributor

A much better screenshot 👍

 

You're using innerText, you might want to use a different property, e.g. contentText.

 

Since you can't output null, you need to check whether the cell is not null, then output

 

You are looping through two rows? Tables have rows and columns, which you need to loop through. 

 

For example, here's table

rraghvani_0-1669630413263.png

I can access the contents of each cell via Table("customers").Cell(0, 0), Table("customers").Cell(2, 1) etc where Cell(row, col) values. 

Ilakkk
Occasional Contributor

Hi rraghvani, I have tried with contentText also it displays empty log while am using innerText only it shows row values. Still, I didn't find solution for this, because of same error in cell

exactly on for loop I have highlighted,

for(var t=0;t<table.rows.length;t++)

for(var u=0;u<table.row.item(t).cells.length;t++)

Log.message(table.row.item(t).cells.item(u).innerText); tried in debug for cell is Cells is not defined

and also am having n no.of tables in the current page. I think for cell value it gets confused

Give me exact solution plz rraghvani

cancel
Showing results for 
Search instead for 
Did you mean: