TestProject Forum

How to write text in cells in table where 1. table is div based dynamic entity

Hi All,

we are trying testProject on Infor application and One scenario is there , I need to write data in cells of each row of table where table is div based element
.There is “NEW” button is there on top of table.
By clicking on New button , new row/record is getting open in table and I have to write data in all cells.
I need to click again NEW button and fill all columns of newly added row. process will add multiple records(input file) as per excel sheet data available .

Here issue what I facing is , Every row and it’s cells of table having dynamic selectors.

how can I write data in every newly added row’s cells with dynamic selector can any one suggest please.

Please see below table for reference.

hello @arjunasaram.rode , try to write dynamic xpaths to the elements

Hi @ahmad ,

Thank you for the reply. Here in dynamic element I need to use ‘*’ like we are using in selenium.
For example “/html/body/div[2]” this is my xpath and on place of 2 I am getting any number and it don’t having pattern.Sometimes it is 44 sometimes 9 …like this .so I can’t make it in logic box. Can you please help me in that.

hello @arjunasaram.rode ,
counter is a parameter here
counter will count the total elements or and then you can get the text of last element whatever it is

Thank you @ahmad for reply,

But in my case counter is not working because here we don’t have any fixed pattern of number as a solution , like Counter + 2 or counter++. Counter value is dynamic. it is like sometimes 2,44,22,19 etc.so getting issue with counter initialization
my xpath is like.

first time : /html/body/div[2]
after page load : /html/body/div[44]
again refresh page : /html/body/div[22]
again page refresh :/html/body/div[19]

like this dynamic selector getting generate. Here do we have any solution(In selenium we aare using ’ * ') which i can replace with this dynamic number , so it should work in case of any dynamic number.