Forum Discussion

vinothps's avatar
vinothps
New Contributor
11 years ago

Find the Row Number from the HTML table

Hi,



I have to find the Row number from the HTML table using the string value.



Eg: strName= "Vinoth"



Using "Vinoth", have to find out where its located in the HTML table.



Thanks,

Vinoth P S



4 Replies

  • vinothps's avatar
    vinothps
    New Contributor
    Hi,



    Can you please provide the solution for the above query.



    Thanks in advance.



    Regards,

    Vinoth P S
  • ishan_07's avatar
    ishan_07
    Occasional Contributor

    Hello,
    You can get the row id using javaScript. Following is the code for the same. You can verify it.

    function  getId(element) {
        alert("row" + element.parentNode.parentNode.rowIndex + 
        " - column" + element.parentNode.cellIndex);
    }
    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi,

       

      a) This is TestComplete forum, thus Selenium code will not work;

      b) It is pretty kind of you replying to the 6 (six) years old thread.