Menu

Test Arguments

Help
Roach
2005-10-05
2013-04-25
  • Roach

    Roach - 2005-10-05

    Hi,

    I have a question regarding submitting arguments through QAT.  I am currently working on a program where the user submits a 425 character string (alpha numeric characters) with 56 seperate fields within this string.  The program then analyzes this string and performs validation on the fields within this string.  When any one of the fields is invalid, the program then returns a refusal code depending on the situation.  There are about 1000 codes that can be returned when a string is invalid, depending on what the problem is.

    I have been conducting testing on this for the past while, and was planning on using QAT to manage the high number of test cases that I have already.  My question is:  Is there any way to submit arguments through QAT instead of having to modify the actual test program.  The arguments that I would submit would be the 425 character string that I talked about above, and the refusal code that I am expecting back.  Ideally I would like to have a test client that would accept these arguments through QAT and run against my program. 

    I noticed in QAT, if you right click a test case and select "Edit Test File" there is "agent_params".  Is this the field where I could enter my arguments?

    Thank you for your patience, I am still new to the QAT program so this question may seem intuitive to you.

    Cheers,

    Brodie

     
    • Roach

      Roach - 2005-10-05

      In regards to the above post, I was toying around with the arguments in the test file through QAT and found that arguments can be passed this way.  So now I have another question, what is the best approach through QAT to do batch testing.  Say I wanted to submit 20 test strings (425 character string) with 20 refusal codes (a refusal code that I am expecting back for each of the test strings).  I do not want to have to create 20 different test files, ideally I would like to pass all these arguments at once. 

      One approach I was thinking would be passing a file path to  a data file that would contain all of this test data.  I'm not that experienced with automated testing, so I'm not sure if this would be the best approach or if there is support within QAT for this.

       
      • Web Hiker

        Web Hiker - 2005-10-05

        I think the most logical way to do this is to have 20 test files, each containing something like
        TEST_STRING=.... 425 char code...
        REFUSAL_CODE=.....whatever....

        and named something logical like DATA_1.qinc, DATA_2.qinc etc.

        You then write a single test case which does a for loop and include similar to :

        FOR I = 1 TO 20 DO
        INCLUDE ("DATA_"+I+".qinc")
           .....
          set the agent arg to TEST_STRING...
          run the test ....
          check the output matches REFUSAL_CODE...
        END

        Hope this make sense.

         
    • Roach

      Roach - 2005-10-12

      Hi Web Hiker,

      I just had a question regarding the STATUS_CODE received from a process.  It says in the documentation that a status code = "0" indicates that the process executed successfully.

      Now in my above post I mention that I am dealing with various refusal codes, and you suggested to compare my expected refusal code to the output from the program.  My question is how can I return a refusal code instead of '0' in my java program??  Is there a java method in which I can set what I return value or would I just return a string in my java program and compare that to my refusal code?

      Thanks for the help!

       
      • Web Hiker

        Web Hiker - 2005-10-13

        There is a QASH command SETRESULT(...) which can be called.
        How about checking the exit code inside the Java test itself, and then returning the value 0 if it went OK, non-zero otherwise, then you don't need to do anything special in the QASH script..

        There is more than one way to do this tho.
        You can inspect the output traces for certain strings using the STDOUTCONTAINS(...) command.
        Check http://qat.sourceforge.net/documentation/QASHSyntax.html#STDOUTCONTAINS

         

Log in to post a comment.