Forum Discussion

jcatayong's avatar
jcatayong
Contributor
7 years ago

How many variables can be add on the Project temporary and persistent variables?

 

I'm a newbie on TestComplete and I'm trying to create a some how Page Object Model using the tool. I used the Project Temporary vairables and Persistent variables to store element's/UI object's property, property value and xpath. My question is
What is the maximum number of variable that can be store on the Persistent variables and Temporary variables? Just to make sure I'm not doing something that will end up to rework. Or is there any way to store Objects with their properties in the tool?

Thanks in advance!!!

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    From the technical point of view, there is no limitation on the number of (temporary) project variables. (Well, at least no one reported such problem here yet.)

    However, XPath and Page Object are far not the best practices in TestComplete's world.

    It is much better to use .FindXXX() and .WaitXXX() methods provided by TestComplete (.FindChild(), WaitWindow(), .WaitButton(), etc.) instead of XPath.

    TestComplete provides you with Objects Tree that is effective replacement of the Page Object model. And exceeds it if NameMapping and Aliases are used. https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ is a recommended video to get a good understanding of NameMapping and the whole https://support.smartbear.com/screencasts/testcomplete/ page is worth to be bookmarked as well.

     

    One more note: Unlike Selenium, Appium, ..., TestComplete provides fantastic documentation that is really worth detailed reading. At least, I would recommend to go through the description of every function that you will use in your test code to get better understanding of how it works and be aware about its specifics.

     

    A little-bit extreme summary: the sooner you will forget about Selenium practices and move to Aliases and .FindXXX() the better will be your test code. :)

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      AlexKaras wrote:

       

       

      A little-bit extreme summary: the sooner you will forget about Selenium practices and move to Aliases and .FindXXX() the better will be your test code. :)


      Couldn't agree more.  TestComplete has a built in feature that takes care of object identification for you.  There is no need to "reinvent the wheel" and construct a POM within TestComplete, at least for object identification.

       

      Now, you can still go the route of having classes and code units for each page containing methods for executing tests and actions against components on those pages, but I'd strongly recommend that those units only contain the method code, not object identification code.  Use Aliases to build out your object structure you want to use and reference those aliases in their method code.

       

      cunderw, don't you do something like this in the framework you demonstrated at Connect?  Perhaps you could speak to this a bit.

      • cunderw's avatar
        cunderw
        Community Hero

        Yeah absolutely. Basically they way I go about is to map top level components, tables, panels, etc... 

         

        Then you have action script units for each sub  application / page that handle finding inputs, buttons, data from tables etc.. using find methods. These are used as building blocks for tests, no local or individual actions are handled by the tests themselves, they just call these utilities in the order needed for the tests. This allows you to update object properties and even entire flows, data and field validations etc... in one single place to keep all of your tests working.

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    I guess you had background of Selenium experience, TestComplete provides NameMapping concept in-order to maintain your objects as you are new to TestComplete you watch this video to get intro with NameMapping concepts.

     

    Personally, I would not recommend to store your object properties in Project Variables. You can follow some approaches mentioned in the topics,

     

    https://community.smartbear.com/t5/TestComplete-Desktop-Testing/How-to-overcome-count-limitation-of-Persistent-Variables/td-p/150904

    https://community.smartbear.com/t5/TestComplete-General-Discussions/Project-Variables/td-p/124081

     

    To answer your question, I don't think there is a benchmark count for number of variables that can be added into Project.

     

    We have 150+ persistent and 250+ temporary variables for a project without having any issues. 

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Some time ago I have played with adding of project variables. I confirm that you can have at least 10,000 variables without any problem :)