Forum Discussion

dhanapal1's avatar
dhanapal1
Contributor
14 years ago

How to fetch values from this table?

Hi

      I need to get data from the web table which is dynamic table so, I used FindChild method to get the value from table. I am unable to retrive those values.  please see the below code  and guide me how to get values from the table.  In attachement I have attached namemapping file and table screen shot.  How to fetch values from this table?

function Test1()

{

  var iexplore;

  var panel;

  var table;

  var proValue, actValue, w;    

  iexplore = Aliases["iexplore"];

  iexplore["ToURL"]("http://ifsmba009/transactor/Content/topPage.htm?*");

  panel = iexplore["pageMiserBa"]["frameThisapp"]["frameMainframe"]["formTheform"]["tableFieldstable"]["cell"]["panelDiv1"];

  table = panel["tableIdformattable"];

  table["cell"]["radiobuttonRddetail"]["Click"]();

  table["cell111910"]["Drag"](18, 12, 257, 1);

  table["cell12500"]["Click"](35, 13);

  table["cell637801607095"]["Click"](28, 10);

    

     //w  = new Array();

    // Creates arrays of property names and values

    proValue = new Array("0bjectType", "innerText", "RowIndex");

    actValue = new Array("Cell", "NDA. SUMMARY", 84);

    

    // Searches for the cell then focus that item

    w = table["FindChild"](proValue, actValue, 2);

     w["focus"](); 

    Log["Message"]("Message: "+ w["innerText"]);   // Object does not exit error is coming.

}

 





5 Replies

  • Hi jared



         Now I can able to get the values from the table.  Which is dynamic table but I am unable to click the radiobutton in specfied row.  once the search criteria is matched means i need to clik the radiobutton. If i used objName["cell"](i, 0)["Click"]() then it goes to row what row index stored in Namespacing file. 



        please suggest me how to click that radio button which is presented in the row. the table hierachy is Table ->Cell ->Radiobutton







    function Test1()

    {

        var iexplore;

        var table1;

        var transdate, trcd, desc;

        iexplore = Aliases["iexplore"];

        table1 = iexplore["pageMiserBa"]["frameThisapp"]["frameMainframe"]["formTheform"]["tableFieldstable"]["cell"]["panelDiv1"]["tableIdformattable"];

     

         transdate ="05/02/11";

         trcd ="CX";

         desc="";


          AppTbl_FindRowByColVal(table1, transdate, trcd, desc);

    }


    function AppTbl_FindRowByColVal(objName, val1, val2, val3)

    {


        if ((val1 != "" )&& (val2 != "" )&&(val3 != "" ))

       {   

         for (var i = 0; i<= objName["RowCount"]; i++)

         {

        

           if ((objName["rows"]["item"](i).cells(1).innerText == val1) && (objName["rows"]["item"](i).cells(3).innerText == val2))

            {

              objName["cell"](i, 0)["Click"](); 

              //Log["Message"]("the given TransDate = " + transdate + "trcd = " + trcd + "description = " + description + "is correct");

            }

         

        } 

       }

  • Hi,



    If your radio button is inside a table cell, it will be the cell's child. Get it via the cell's child object collection and click it.

    For example:

    var btn = table.rows(some_index).cells(some_other_index).firstChild;

    btn = table.Parent.Find("uniqueID", btn.uniqueID, 10);

    btn.Click();

  • Hi

         I tried in below ways even though I got error like "'ObjectType' is null or not an object"  could pls tell me what mistake i did.   I need to find ObjectType = RadioButton and want to click the radiobutton.

    Trial -1

    var
    rbtn;

    rbtn = objName.rows(i).cells(0)["FindChild"];

    rbtn = objName.Parent.Find("0bjectType", rbtn.ObjectType, 2);

    rbtn.Click();



    Trial -2



    Here I got error like "You are trying to call the "Click" method or property of an object that does not exist."

    var proValue, actValue, w;

    proValue = new Array("0bjectType", "RowIndex");

    actValue = new Array("Cell",1);

    // Searches for the cell then focus that item

    w = objName["Find"](proValue, actValue, 1);

    w["Click"]();





    Thanks

    Dhanapal

  • Hi,



    rbtn = objName.rows(i).cells(0)["FindChild"];


    This line is invalid. objName.rows(i).cells(0) doesn't have a 'FindChild' property. rbtn contains an empty value after this line.