Forum Discussion

DeepaJ's avatar
DeepaJ
Contributor
9 years ago

Checking if an Object contains a specific number

Hi,

 

On my desktop application, I have a page that returns results of a search. The result pane is considered as 1 Object although there are many rows and columns within it. Everytime I execute the query after some actions, I want to check if the newly generated Number (e.g., Invoice #), is present, within the returned results

 

I saw an article in the documentation that explains how to check if a web page contains a text by using the aqObject.CheckProperty method. However, it does not work correctly for me.

 

Could someone kindly point how to acheive this the correct way? Not sure if  using aqObject.CheckProperty method, is the right thing to do.

 

Thanks!

9 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

     If I understood you correctly you have your results in a grid?
    If so you can use grid methodes to read your number
    once you get the value can compare with expected value and in a check point
    below links has more

    working with grids

    check point

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Need more info.

       

      How you get values depends on what the object is.

       

      So what language is the application written in?

       

      And what is the object containing the results? (the class name ideally) (And if the object is a custom grid, try and find out the base class for it)

       

      Without knowing this, it's guesswork.

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi,

    Couldn't youuse the dataset behind the grid ?

    Check if there is a datasource, dbl-click with the spy object, then reach the dataset, then explore the methods your dataset have (.Find() or equivalent methods ?)

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      @ m_essaid

       

      Yes, you can manipulate the dataset object.

       

      BUT (and it's a big but)

       

      By doing so, you are NOT testing the application properly. The user does not interact with the dataset object. They interact with the GUI. So if you use methods attached directly to the dataset, which would normally be triggered by interaction with the GUI, then you have failed to test the GUI.

       

      I generally only use the dataset object for reference purposes (such as looking up field names). You should avoid driving it, to drive your test though.

       

      (And without debug info in the compile, I'm not sure you'll be able to access the dataset anyway? If it's a Delphi application ...)

      • m_essaid's avatar
        m_essaid
        Valued Contributor

        Ah you're just right from the begining to the end.

        - I'm not testing the GUI

        - I just should use it to navigate through the datas before testing the GUI

        - and in Delphi without debug infos... you don't have access to the datas.

  • The application is written in Power Builder.

     

    The results returned on the page are within "Panel". The ObjectType is Panel and the WndClass is pbdw125.

     

    The results grid is scrollable and read only. I just need to see if a number (e.g., 1055432), exists within that Panel Object, which contains multiple rows of returned results and columns (Dates, Names, Numbers,....). So it needs to check within that Object to see if the number is present in the Query results as a way of ensuring that my previous actions of adding it worked fine. I am passing this number to the Query page and checking that it exists there.

     

    Appreciate all your explanations as I am very new to TestComplete.

     

    Thanks!

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Ah. We may have jumped the gun slightly by guessing it was a Delphi grid. (It did sound like one!)

       

      I've never used anything built using PowerBuilder unfortunately so I don't know how you go about manipulating your table/datagrid I'm afraid.

       

      But I suspect you may want to start reading here:

       

      https://support.smartbear.com/viewarticle/72444/

       

      ... and then go and speak to the developers to see if they can help you prepare the application so it interacts with TestComplete a bit better.