Forum Discussion

pashooo's avatar
pashooo
Contributor
14 years ago

object exist but isnt visible on screen

Hayyyyo!!!



I tests a grid, but it is so big, that I cant see all the rows at one time (I need to scroll down to see the last row).

So, testcpmplete is able to recognize only rows which is on screen. Then it says that object cannot be found...

Its impossible to scrool evry table becase they all have different size.

Does it possible to verify invisible rows? 



Please share your experiense)

Thanx.

17 Replies

  • Hi Pasha,



    I'm glad it's working fine now!



    As for your question about table checkpoints. A table checkpoint compares data in the grid with baseline data stored in the project item Stores > Tables > checkpoint_name. The baseline data is copied from the grid when you create the checkpoint, that is, the grid's current data at that moment is considered as the baseline data. You can view and edit the baseline data by double-clicking this item in the Project Explorer.



    If data in your tested grid changes during the test run and you need to verify data at different moments, you have several options:

    * create and use several checkpoints with different baseline data;

    * use the same checkpoint in different places in your test, and set the checkpoint's baseline data at run time via Tables.checkpoint_name.Values(row, column);

    * write a custom verification routine that will iterate through the grid cells using the wValue(row, column) property and compare cell values with the baseline values.



    When using table checkpoints, you can also exclude some rows, columns or cell values from comparison -- either when creating the checkpoint, when editing the checkpoint's baseline data in the editor or at run time via Tables.checkpoint_name.ValuesSelected(row, column).



    For more information about using table checkpoints, please see Creating Table Checkpoints and How the Table Comparison Works in the TestComplete documentation.
  • Thank you, your advices and links help me to solve my problem)
  • I faced the similar problem, I need  to compare values in the table and to warn when at least one value is equal zero! The right values in the table are any number differ from zero.









    I have put zero in every slot of Table6 in TC storage and have modified code from your link:









               if(!Tables.Table6.Compare())Log.message("No zero)") //means not all slots contain zero 




               else Log.error("empty slot)") //means all slot containing zero









    ... but I need to get error when at least 1 slot contain zero and message  "No zero" when all of slots dont contain zero! is this construction possible? ...and how should I change my code?
  • Hi Pasha,



    Table checkpoints perform a positive check (the "matches" comparison) rather than a negative check ("not matches"). So, I'm afraid, your scenario isn't supported by table checkpoints.



    To perform this kind of check, you'll need to write a script that would iterate through the grid cells and see if they are 0 or not. Something like this off the top of my head:

    var bNotZero = true;



    check:

    for (var i = 0; i < grid.wRowCount; i++)

    {

      for (var j = 0; j < grid.wColumnCount; j++)

      {

        if (grid.wValue(i, j) == 0)

        {

          bNotZero = false;

          break check;

        }

      }

    }



    if (bNotZero)

      Log.Checkpoint("All cell values are other than 0.")

    else

      Log.Error("At least one cell value is 0.");






    p.s. In the future, please start a new thread for new questions that aren't closely related to the subject of the original question. One question per thread makes it easier for others to find answers by browsing and searching the forums. Thanks!
  • mmmmm... so sorry(

    If not to use TableCheckpoit I will face the problem of invisible rows again.

    It would be rather useful option to be able to change comparation rules of TableCheckpoint like "cmpNotEqual"/"cmpLess", I guess.

  • Hi Pasha,



    If not to use TableCheckpoit I will face the problem of invisible rows again.


    What makes you think so? If you use the wRowCount, wColumnCount and wValue properties added by TestComplete, like in my example, they will work regardless of whether or not the grid cells are visible on the screen. Table checkpoints actually use the same API.



    It would be rather useful option to be able to change comparation rules of TableCheckpoint like "cmpNotEqual"/"cmpLess", I guess.


    I've filed a feature request for this. Thanks for the feedback!
  • Really!

    I had a trouble with using "wValue", but now it's OK.

    I'm using wValue checkpoits and they are able to compare value of invisible cells. 

    Thanx)