Forum Discussion

Intermountain_H_3's avatar
13 years ago

Load Test Statistics Log

Usintg Pro 4.0.0
Experience seems to demonstrate that a context variable (${#TestCase#resultsDir}) gets expanded (LoadTest Options/Statistics Log/Log Folder) before variables specified on the command line (-Dsoapui.properties.%TESTCASE%="%properties%") are populated. Depending on the environment (endpoint also set with command line parameters & set as a test step) I run the load test against, I want to specify the directory where load test results are stored. It appears I'm unable to do that using command line parameters. If this cannot be made to work, can you explain how to adjust that Log Folder value programatically?

Thank you

7 Replies

  • Hi,

    Have you tried using a project-level custom property and overriding that from the command-line with the -P<name>=<value> option!?

    regards,

    /Ole
    SmartBear Software
  • Project level property doesn't seem to work any better.

    I add this to my command line: -poutputDirectory="%OUTPUTDIR%". The property is defined and empty in my saved project. My loadTestOptions.StatisticsLog.LogFolder contains: ${#Project#outputDirectory}.

    No step-dependant statistics files are stored upon command-line execution.

    If my project is stored with a directory contained in that project property, there is a .log file stored for each test step in the specified directory.

    It appears I can get by with the <loadtestName>-statistics.txt file specefied by -f"%OUTPUTDIR%" for now.
  • For that matter, as I get further into things, it appears that no test case or project properties loaded from the command line get loaded prior to load test execution. This greatly limits the ability to perform my load testing from the command line.

    My test case contains the property fileName. One of the first steps in that test case contains: def file = testRunner.testCase.getPropertyValue('fileName') which is then passed to a static java class to read. If the project is saved with that property empty, whatever value passed to my java class (a valid file path on my machine) is not found with this code
    fn = new File(fileName);
    if(fn.exists()) {
    If I populate that test case property in the saved project, the load test runs corectly from the command line, accessing the data from that file.
  • Hi,

    before we dig further; did you specify the command-line project property argument with a capital P? (your example was lower-case)

    regards,

    /Ole
    SmartBear Software
  • Yes. %OUTPUTDIR% gets set previously and is successfully used in the command line switch
    -f"%OUTPUTDIR%"