Forum Discussion

Kalyan2020's avatar
Kalyan2020
New Contributor
6 years ago

How do I know SOAP UI pro executed on a specific environment?

Hi,

 

I have set up various test environments test1, test2, test3. However I am not able to find out whether its executed on a specific test environment test1, test2 or test3. I am executing using testrunner.bat via command prompt. I would like to see in logs or any report where it captures the environment it executed.

Command prompt:

testrunner.bat"  "-RJUnit-Style HTML Report" "-fC:\Users\ABCuser\Documents\SOAP-UI\Reports" "-Etest1"

 

Thanks in advance.

  • JoostDG's avatar
    JoostDG
    6 years ago

    Hi Kalyan2020,

     

    Perhaps there are other ways, but you could put the below in your project setup/teardown script:

     

    log.info "Project run executed on environment: " + project.activeEnvironment.name

    That way, at the beginning/end of the run you can see your chosen environment name in the log. Should be equal to the one you selected with your -E parameter.

    So --> "Project run executed on environment: test1"

     

    You could write this name to a project property, some reports also log these by doing this:

    def active_environment = project.activeEnvironment.name
    project
    .setPropertyValue("active_environment", active_environment)

     

    • Kalyan2020's avatar
      Kalyan2020
      New Contributor

      HimanshuTayal 

       

      Thanks for the response. Yes- I am using the commands from the link you provided, I have mentioned the syntax for the command that used as well in my post.

      We can give instruction on which environment to execute the test cases, however my question is how can we confirm that it executed in the specific environment? I would like to see in logs or in any reports? Please advise... 

      • JoostDG's avatar
        JoostDG
        Frequent Contributor

        Hi Kalyan2020,

         

        Perhaps there are other ways, but you could put the below in your project setup/teardown script:

         

        log.info "Project run executed on environment: " + project.activeEnvironment.name

        That way, at the beginning/end of the run you can see your chosen environment name in the log. Should be equal to the one you selected with your -E parameter.

        So --> "Project run executed on environment: test1"

         

        You could write this name to a project property, some reports also log these by doing this:

        def active_environment = project.activeEnvironment.name
        project
        .setPropertyValue("active_environment", active_environment)