Forum Discussion

steven_yetter's avatar
steven_yetter
Contributor
2 years ago

Keyword Tests - Configuring Expected Data

We wrote Keyword tests in Test complete, but we have expected data that varies on build and test machine.  How do we configure that in test Complete runs?  When we wrote our keyword test, the On-Screen operation of keyword tests allowed us to select the application region or property to test and whatever what was in our application at the time became the expected value.  We don't want to have to redefine our test on every run.   Here is an example:

 

The selected test failed and the pictures show the reason. The test was constructed from an Official Release of our application, but now in QA, the text says [VALIDATION].    This particular case is a region checkpoint.   We'll convert it to a property checkpoint.   But how do we change the keyword test to be configurable?

6 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I'm using the command prompt to set MyVariable to "Goolge Searched", which it fails to find.

    The checkpoint (Run Code Snippet) looks like this,

    Seting MyVariable to "Google Search" instead, passes.

     

    • steven_yetter's avatar
      steven_yetter
      Contributor

      Thank You So Much.!  The details dialog for selecting the variable is what I was missing.  I see I am still not up to speed on everything TestComplete offers.

       

      Do you have a strategy for dealing with a long list of variables?  That command line could get rather long for us.

       

       

       

       

    • steven_yetter's avatar
      steven_yetter
      Contributor

      Great. If I create a variable/parameter and pass it to a property checkpoint, how do I get the property checkpoint to use the value of the parameter.? Every time I edit a property checkpoint it just takes me to the Wizard, where it uses, what it is in the current application.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Unfortunately, I don't use keyword testing. I prefer scripting as it allows me to have more control in what I want to do.

     

    I no longer use project variables, as it can get too messy to maintain. 

     

    In your case, you could try storing the version number into a variable and then verifying the contents like e.g. "Version: " + Project.Variables.Version. Keep project variables to a minimum.

     

    Or ask yourself, is it absolutely necessary to verify that particular content!? 

    • steven_yetter's avatar
      steven_yetter
      Contributor

      Thanks.  I appreciate the feedback on keyword testing vs.  scripting.  I've been wondering about switching to using python even though we have testers with not much coding.  In our other GUI test tool, it is almost all python code.  The recorder generates python.  And tool options like click and wait are described in terms of function calls.  In TestComplete, I am still trying to figure out when I need code to get something done.

       

      Any feedback on code vs keyword tests?  Things you do in code that are difficult in keyword tests?