free seo tool
Showing posts with label soapui project. Show all posts
Showing posts with label soapui project. Show all posts

Invoke soapUI TestRunner from Command Prompt

Let us see how to execute soapUI test cases using command prompt.

In this soapUI Tutorial, we will see how can we invoke and execute soapUI test cases from command prompt. If you are familiar with soapUI application, you might have used/ noticed an option named "Launch Testrunner". We are calling this feature from a command prompt window to execute our project/ test suite or test cases. Let us peform the below steps to achieve this.

1. Open a command prompt
2. Navigate to soapUI bin folder. For example "C:\Program Files\SmartBear\soapUI-Pro-4.5.0\bin".
3. Now type the step testrunner.bat "C:\Project-Path\project-file.xml"
4. Hit enter

This will invoke and execute soapUI project in the specified project file. The above mentione is the simple way of executing a soapUI project using command prompt. But there are different options which we can provide to the soapUI testrunner.bat to configure the test execution. Here are the parameters which can be used to invoke soapUI testrunner in command prompt.
e : The endpoint to use when invoking test-requests, overrides the endpoint set in the project file
h : The host:port to use when invoking test-requests, overrides only the host part of the endpoint set in the project file
s : The TestSuite to run, used to narrow down the tests to run
c : The TestCase to run, used to narrow down the tests to run
u : The username to use in any authentications, overrides any username set for any TestRequests
p : The password to use in any authentications, overrides any password set for any TestRequests
w : Sets the WSS password type, either 'Text' or 'Digest'
d : The domain to use in any authentications, overrides any domain set for any TestRequests
r : Turns on printing of a small summary report (see below)
f : Specifies the root folder to which test results should be exported (see below)
j : Turns on exporting of JUnit-compatible reports, see below
a : Turns on exporting of all test results, not only errors
o : Opens the generated report in a browser (soapUI Pro only)
i : Enables soapUI UI-related components, required if you use the UISupport class for prompting or displaying information
t : Sets the soapui-settings.xml file to use, required if you have custom proxy, ssl, http, etc setting
x : Sets project password for decryption if project is encrypted
v : Sets password for soapui-settings.xml file
D : Sets system property with name=value
G : Sets global property with name=value
P : Sets project property with name=value, e.g. -Pendpoint=Value1 -PsomeOtherProperty=value2
S : Sets to save the project file after tests have been run
I : Do not stop if error occurs, ignore them
R : Selects which report to generate for the test objects executed, for example if running the entire project, this could specify the name of a test-suite-level report that would be generated for each TestSuite. The report is saved as specified with the -F option to the folder specified with the -f option. (soapUI Pro only)
F : Sets the format of the report specified with the -R option, for Printable reports this is one of PDF, XLS, HTML, RTF, CSV, TXT, and XML. For Data Export this is either XML or CSV (soapUI Pro only)
g : Sets the output to include Coverage HTML reports ( soapUI Pro only )
E : Sets which environment to use (soapUI Pro only)

soapUI Test Runner from Command Prompt Example

testrunner.bat -rjf "Results" "C:\Project-Path\project-file.xml"

Read more »

Project Path Using Groovy in soapUI

While doing automation testing we might need to get the project path/ folder to access other files or resources. soapUI provides this feature in the below way.



def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectDir = groovyUtils.projectPath
log.info(projectDir)

Now the variable projectDir has the project path which can be set as one of the project properties and can be used in later stages.

Read more »

soapUI Setup TearDown Script

If you are familiar with automation testing, you know the importance of an initial setup/ initialization option in any automation framework. soapUI also provides the feature of executing an initial setup and tear down script for web services testing.

  • Initial Setup Script :  soapUI initial setup is just a place holder/ an editor for writing your initial script before start your testing. This setup is available in two levels, TestSuite level and testCase level. The groovy script written in the TestSuite option will be the first one to trigger just before the execution of that testSuite. Same for testCase, the setup script written in the testCase level will be the first to trigger just before the execution of that particular test case. The main purpose of the Initial Setup section in soapUI is to provide the user the initial property creation, initialization, etc even before the test case execution.
  • TearDown Script : This is same as soapUI initial setup, the only difference is the code/ script written in this section will trigger only after the completion of testCase / testSuite depending upon where the script is written. The main purpose of this is to cleanup the automation suite like delete unwanted file, kill common objects , custom reporting etc.
log, runner, context and testSuite variables are available in both setup and teardown scripts.

Read more »

Creating a Project in soapUI

In this post, let us see how can we create a Project in soapUI. To test web services, we have to have a project created in soapUI tool.

The first step to create a project is to get access to the WSDL url. This is a url ending with ?WSDL.
Before we create a project we have to understand the hierarchy in soapUI. The top most level of the hierarchy is a Workspace. Workspace is a container to hold multiple projects. In otherwords a workspace can have multiple projects. By default there will be one workspace created by soapUI. You might create a new one to hold all your projects. Under Project we can have multiple Test Suites. Under Test Suites, we can have multiple test cases and under test cases, we can have test steps.


Lets create a workspace. 
  • Click on File and then select New Workspace.
  • Enter the name of a workspace.
  • Select the location to save the file.
  • You will get an empty workspace.
Now, lets create a project on the workspace.
  • Click on File and then select New soapUI Project.
  • Enter the name of the Project.
  • Provide the WSDL url in the box.
  • Uncheck "Create Requests" check box. This not required.
  • Select Ok
  • This will create a Project with the interface details from the provided WSDL.
Lets move on to creating a Test Suite.
  • Right Click on the project
  • Select Create new Test Suite
  • Enter the name of the test suite.
  • Click Ok
  • This will create a test suite.
Our Next Step is to create a Test Case.
  • Right Click on the Testsuite
  • Select Create New Test Case
  • Enter the Name of the test case.
  • Click Ok
  • We will get a test case with zero test steps. 
There are multiple test steps, we will discuss those on other posts. 
Let us create one step to test our project.

  • Right Click on the test case.
  • Select Add Steps.
  • Select Test Request.
  • Enter the name of the method/ operation.
  • Click OK
  • This will display a list of all the methods available in the WSDL.
  • Select one from the list.
  • Uncheck the check boxes in the assertion window. We will discuss this later.
  • Click Ok.
  • This will create the request.
  • Enter values for the request and click Run button "Green Play button"
  • This should provide you the valid response for the request.

Read more »