Forum Discussion

baba_k's avatar
baba_k
Occasional Contributor
13 years ago

Issue in object recognition

Hi..

We are facing an issue in object recognition during our functional testing of an windows based application. We have grid on the screen and we need to get the no.of items in the grid using the object properties. Test complete is not recogninsing the object as grid. Please find the attached screen shots for the object screen and object properties

3 Replies

  • Hi,



    TC has access to your grid's properties. Just look at it in the Object Browser and find a property which will give you the row and column count. You can use the property, method or field you use in your application to get the same information about your grid.



    As for 'recognizing the object as grid', can you clarify what you mean by this? TC is able to capture your object and access its properties and methods. For supported controls it also adds special ones, but your grid doesn't seem to be supported.
  • baba_k's avatar
    baba_k
    Occasional Contributor
    Hi Jared,

    Thank you so  much for your quick reply and i tried with the property 'Row count' and it worked. But i need further help , we need to compare this row count with no.of records in data base. i have written script to execute SQL query and that query is also returning the same value as row count. Now the issue is we are posting the value returned from SQL query to the TC log. Is there any way to comapre the row count captured through script with value posted to TC log or else can we store the value returned from SQL query to a variable.

    Below is the code i have written:

    Orderitemcount= Aliases.Agresso.Agresso_Mainwindow1.AWO_Window.AWOItems.RowCount



    log.Message(Orderitemcount)


    .Message(Orderitemcount)

    'Executing SQL Query to verify the no.of records for the same AWO in data base



    Set Qry = ADO.CreateADOQuery


    Qry = .CreateADOQuery

    ' Specify the connection string



    Qry.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Agresso_QA;Data Source=GLNWD021\QA"



    ' Specify the SQL expression



    Qry.SQL = "Select count(*) as count from aq1orderitem where awo_id='"&Project.Variables.NewAWO&"' and Client='LD'"


    Qry.Open



    Log.Message("No of Items for the AWO "& Qry.FieldByName("count").Value)


    .Message("No of Items for the AWO "& Qry.FieldByName("count").Value)

    Qry.Close




    Regards,

    Baba.
  • baba_k's avatar
    baba_k
    Occasional Contributor
    Hi,

    we are able to capture the value returned by SQL query to a variable. Our issue was resolved.

    Thanks a lot for your help...