RestFul Api

  • Handles Restful Api connection and configuration info

  • Located automation -> resources -> properties -> environment -> dev.property or qa.property

  • # global configuration
    service.csv.separator = ","
    api.uriPath = http://demo.autonomx.io
    api.parallelTestcasePath = "../apiTestData/testCases/"
    api.csv.include.subdir = false
    api.actionTestcasePath = "../apiTestData/keywords/action/"
    api.templatePath = "../apiTestData/templates/"
    api.templateDataFile = "../apiTestData/templates/data/"
    api.base.path = "../apiTestData/keywords/testBase/"
    api.base.before.testfile = "TestCases_RunBefore.csv"
    api.base.after.testfile = "TestCases_RunAfter.csv"
    api.base.before.suite = "TestCases_RunBeforeSuite.csv"
    api.base.after.suite = "TestCases_RunAfterSuite.csv"
    # timeout in seconds for api calls to return response
    service.response.timeout.seconds = 60
    # will retry the request, expecting to pass validation for duration of specified duration in seconds
    service.timeout.validation.isEnabled = false
    service.timeout.validation.seconds = 2
    service.timeout.validation.delay.between.attempt.seconds = 3
    service.retry.count = 0
    service.retry.after.seconds = 0
    # set file name to run single csv file
    api.testCaseFile = ""
    api.testCase = ""
    # api url encoding
    api.encoding.url = true
    api.encoding.parameter = false

    Parameters

    parameters

    description

    api.uriPath

    base uri path for the api requests

    api.parallelTestcasePath

    the location of the test case csv files for parallel runs

    api.csv.include.subdir

    option to read test cases from the sub directories specified by api.parallelTestcasePath

    api.actionTestCasePath

    the location of the test case csv files for external csv files.

    api.templatePath

    file path for test templates. This could include xml files to be used for request body of api calls. See template section

    api.templateDataFile

    file path for template data directory. See template data file

    api.base.path

    See Test Base section

    api.base.before.testfile

    See Test Base section

    api.base.after.testfile

    See Test Base section

    api.base.before.suite

    See Test Base section

    api.base.after.suite

    See Test Base section

    api.testCaseFile

    test case file name for running a single csv file

    api.testCase

    single test case in a csv file to run. testCaseFile must be set for this to be valid

    service.response.timeout.seconds

    timeout duration for getting response from rest api call

    service.timeout.validation.isEnabled

    Enable timeout validation. Timeout validation will retry tests the api test until the validation requirement is met, within the duration specified.

    Can be set in CSV file as well, in the RestFulAPI Interface, Option column.

    • will override value set in Config file

    eg. WAIT_FOR_RESPONSE:2

    • 2 is the number of seconds to wait for the validation requirement to be met.

    • Validation requirement set at columns:

      RespCodeEx, ExpectedResponse

    To disable in CSV file, set in Option column:

    NO_VALIDATION_TIMEOUT

    service.timeout.validation.seconds

    Max wait time for validation. Timeout validation will retry tests the api test until the validation requirement is met, within the duration specified.

    service.timeout.validation.

    delay.between.attempt.seconds

    Delay in seconds between each try attempt.

    service.retry.count

    Retry count for Rest api calls. If test fails, it will retry.

    Choose either service.timeout.validation or this option

    service.retry.after.seconds

    Seconds to wait between each retry count