Topic
  • 1 reply
  • Latest Post - ‏2013-03-20T10:27:20Z by SystemAdmin
SystemAdmin
SystemAdmin
16727 Posts

Pinned topic How to find Particular cells in HTML table and verify the values

‏2013-03-01T19:22:50Z |
Hi,

We have a Table with all the Student Added, Withdraw changes...etc. My Script adds and deletes some students and my final validation is to verify if the Student got updated as add or change for that particular course and semester. The Location of the Values keep changing, depending on how many have accessed that student on that day.
for example: I have to validate 8835 course for sem 6 is with the status Add
Some times 8835 will be on first line in HTML Table, some times it will be on 2nd line with add status. we don't know if which row of the table this value gets updated.

Using RFT can we find where that particular value is in the table and Verify ? Please let me know. this fix will be useful for more than 20 scenarios.

Thanks
RFT worker
Updated on 2013-03-20T10:27:20Z at 2013-03-20T10:27:20Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to find Particular cells in HTML table and verify the values

    ‏2013-03-20T10:27:20Z  
    Hi Rft worker,

    you can work with html tables with below code

    public void selectFirstRow()
    {
    try{
    TestObject[] cellObjvalues = table_name.find(atList(
    atChild(".class" , "Html.TBODY"),
    atChild(".class" , "Html.TR",".rowIndex",1),
    atChild(".class","Html.TD",".cellIndex",1)
    ), false);

    if(cellObjvalues.length==1)
    {
    for(TestObject t:cellObjvalues)
    {
    System.out.println(t.getDescriptiveName());
    GuiTestObject IncValue=(GuiTestObject)t;
    IncValue.click();
    }
    }
    else
    {

    }

    }
    try this, in my next post, i will give you ready made methods which can work for any rows and columns.