Forum Discussion

kamatchipriya's avatar
kamatchipriya
Occasional Contributor
8 years ago

Run Soap UI prompt from command prompt

Hi,

 I am using soap ui version 5.2.0. i am selecting my project environment from soap ui prompt. but i need to run my project from command prompt. how do i show up the popup from command prompt. could pls give some suggestions?

  • Thank You. i found solution for this.  i am running my environment variable by setting as a global property and get it from command prompt using -P. 

  • Feel free to mark accepted as solution, so others can find the answer easily when searching later kamatchipriya. :)
    • kamatchipriya's avatar
      kamatchipriya
      Occasional Contributor

      i mean i want to show soapui prompt environmental variables in command prompt. i am setting environment variables in my project. i need to choose when i run my project from command prompt...

      • nmrao's avatar
        nmrao
        Champion Level 3
        Sorry, could not get it.
  • 05ten's avatar
    05ten
    Contributor
    Please show us what you are running so that we can better understand what you need help with.
    • kamatchipriya's avatar
      kamatchipriya
      Occasional Contributor

      I want to choose my environment like dev or local from command prompt...how do i choose it when running my soapui project from command line? i am using soapui free version. 

      • 05ten's avatar
        05ten
        Contributor

        From the picture you posted i can see that you are creating the dialog yourself from a Groovy script to toggle environments yourself, which is fine. What i would do if i wanted to run the script in a headless environment is to first wrap the

         

        UISupport.showPopup(...)

        With a isHeadless() test. 

         

         

        def environment = '';
        if(UISupport.isHeadless()){
            def environment = project.getPropertyValue("my.environment.prop") ?: "defaultEnvironment" }else{     UISupport.showPopup(...) //select environment in gui }

        And specify the environment right at the commandline using -Pmy.environment.prop=devLocal

         

        Does that help? 

  • 05ten's avatar
    05ten
    Contributor
    Also you should save the result of the prompt in the environment variable.
  • 05ten's avatar
    05ten
    Contributor
    Feel free to mark accepted as solution, so others can find the answer easily when searching later kamatchipriya. :)