How to loop through rows in a table
Posted: Thu Apr 15, 2010 4:52 pm
Hi
I am trying to automate a Java web app.
There is a table in the application (that I want to control) which contains a number of rows (with about 8 columns).
I wish to be able to loop through the rows in C# and then click on the first column if it contains a certain "innertext" value in the third column.
I am new to Ranorex and am not sure how to do this.
The Ranorex path for the first row (and first text column) is as follows:
"/dom[@caption='PureDeal']/body/div[@id='dragArea']/div[@id='divOpenPositions']/div[@id='ifrOpenPositionsHolder']/iframe/body/div/div/table/tbody[2]/tr[@id='yui-rec11']/td[2]/div/a[@innertext='CellTextHere']"
Now I can replace the expression: @id='yui-rec11' with the number 1 for first row
but I when I remove the innertext expression it no longer finds the cell.
I wish to loop thru all rows and read the values of innertext in columns 1 and 3. If the match a criteria I wish to click on column 1.
Please help
Thanks
I am trying to automate a Java web app.
There is a table in the application (that I want to control) which contains a number of rows (with about 8 columns).
I wish to be able to loop through the rows in C# and then click on the first column if it contains a certain "innertext" value in the third column.
I am new to Ranorex and am not sure how to do this.
The Ranorex path for the first row (and first text column) is as follows:
"/dom[@caption='PureDeal']/body/div[@id='dragArea']/div[@id='divOpenPositions']/div[@id='ifrOpenPositionsHolder']/iframe/body/div/div/table/tbody[2]/tr[@id='yui-rec11']/td[2]/div/a[@innertext='CellTextHere']"
Now I can replace the expression: @id='yui-rec11' with the number 1 for first row
but I when I remove the innertext expression it no longer finds the cell.
I wish to loop thru all rows and read the values of innertext in columns 1 and 3. If the match a criteria I wish to click on column 1.
Please help
Thanks