Forum Discussion

vibe's avatar
vibe
Occasional Contributor
13 years ago

How to obtain needed link in Web table control

Hi -









To obtain any objects in my scripts i use the 'FindChild' method. Therefore i need some unique property of this object.




In my current case i have to click on specified link that located within some cell of the web table. How to achieve that? 




That is full path to the link:









Sys.Process("iexplore", 2).Page("http://").Form() ...




...Table("MainBodyPlaceholder_MainBodyPlaceholder_RFX_myRFxGrid_DXMainTable").Cell(2, 1).Link(0).









I can't use this since row index in the Cell can be different from time to time. I have only link name as defined property. And table column is always the same, but row can change every run. Maybe loop through the column to find needed cell but how to attain this knowing only link name?









Thank you!




1 Reply

  • vibe's avatar
    vibe
    Occasional Contributor
    The solution is following:



    for (var i=0; i<RFx_table.RowCount; i++ ) // loop through column in table

         

               {

           

     var str = aqString.Trim(RFx_table.Cell(i,1).innerText, aqString.stTrailing)   // read the text in the cell using innerText  property. Use Trim method to remove space at the end of text, innerText property adds space for some reason

             if (str == "test5") 

               

              RFx_table.Cell(i,1).Link(0).Click();

              

               }