Search for:

4 SOAPSonar – Using Automation Data Sources

In Tutorial 2 we got started with REST and SOAP service, using design view and doing a unit test. In Tutorial 3 we chained the response from one service to be a request for a second service, creating a mash-up test between REST and SOAP services to run in Run View. In this tutorial we going to show how to use an external source like a .csv file for automating a range of values. This is represented in the test cycle by variables and data sources. 

Why use Automation Data Sources? Well lets say you need to test a range of users, or values. Take Canadian postal codes as an example. There are 845,990 Canadian postal codes. Yet when testing, you may not need to test all of them. However each province, has 1 or more letters that start the postal code for the region. All BC postal codes starting with V. There is 18 possible start letters, each mapped to a given area. If your percentage coverage requires validation of address by checking postal code to province and includes testing negative scenarios, you could be required to run the same test case through 20 or more unit tests. If you have read more detailed service plan costing, you can see that 20 unit tests through many test iterations can add significantly to testing costs. The challenge however is to do this, without spending too long on the test creation or maintenance. If each release requires new scripting, the value of automation greatly decreases.

I am going to first use the SOAP calculate service, but show a JSON service example afterwards.

1. Lets first create our data source. There are many places on the web to find already created data sources, but in this case, I will use MS Excel to create one and save it as a CSV. I created 6 columns, input A, Input B and then the expected results for each service. I have only 10 lines, but you can make these much longer. Here is the calculate csv file for you to download.

1 Create csv

2. Run SOAPSonar (with Admin Rights) and in the capture WSDL bar paste http://www.html2xml.nl/Services/Calculator/Version1/Calculator.asmx?wsdl. and press enter. Select Configure Project Data Sources. Here we define any Automation Data Sources we may use.

2. Config data sources

3. Now select Add Automation Data Source. You can see that ODBC, SQL, Oracle, Excel or File bases data sources are supported. Select File Data Source for .csv.

3 Add data souce

4. Give your Data source a Alias, Locate the .csv file you downloaded and ensure its still Iteration, and Data Series in rows. On the right of Data Variables field (were my curser is), select the option to refresh data and view data. Do you now see your .csv file? Select OK.

4. Refresh

5. Now lets use that Data Source on the Add_1 function. Make sure you are in Project View, and QA mode and Select Add_1. Right-click in a= field and select [ADS] Automation Data Source, Quick Select, Your Alias (mine is calculate), Input A column. do the same in b= field selecting Input B. Commit the test settings.

5. Project view

6. Now select Run View, and Drag Add_1, under the DefaultGroup. Commit. How many test case did you expect run? Run Suite to execute the test suite.

6 run view

7. You can see I ran through the entire csv file rows, or 10 test cases. You can Analyse These Results in Report View, but we will leave that and Success Criteria for another tutorial.

7. Results

8.Lets try this with JSON. File, New Test Group. File, New JSON Test Case and paste http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false into the URI and make sure method is GET.

8 Google URI

9. Lets add our data source  Add this googlemaps .csv file to you Data Sources as a file data source. Remember to refresh and check it before saying OK.

8. maps

10. Now in the URI highlight (delete) toronto and right-click (insert) and select [ADS] Automation Data Source, Quick Select, Cities, Origin. Do the same for montreal. Commit.

10 insert

11. Drag your Test case over to Run View and commit and run suite. How many test cases did you run now?

11. run

Conclusion

You have just used a Automation Data Source in both a JSON and  SOAP Service. Running multiple values through a unit test, vs manually entering these same values. What is important to consider here is putting the right values into the CSV file to test as many variables as needed. Using a Tool like SOAPSonar with a Automation Data Source, increases your coverage, and reduces the time taken to run test cases. Whats more, since it is not script bases, there should be little issue if any, running it again on the next code release., further reducing testing time.

Comments?

3. SOAPSonar – Run View with Chaining

If you have not, please do Starting with SOAP and REST Tutorial first.

Automation lets you test the business flow scenarios. So now lets model a very simply business flow. Lets take an example, the company uses a 3rd party API for calculating distance between cities. This is a REST service. They have a second API that they use to calculate. The Client application makes use of both. The test requirements are that users are expected to calculate the time it would take to ride a bicycle between Toronto and Montreal if you travelled and average speed of 20 km/h. To do this we set up out test cases in project view and run it in Run View. But to automate this, we need the response from one service to be the input into the second. This we at ST3PP refer to chaining services for automation.

SOAPSonar Test Cycle

TUTORIAL

1. Open SOAPSonar, and lets first add the REST distance service. In this case I am going to use Google Maps. File, New, Test Group. Then right-click on Tests in the Project Tree and select New REST Test. It’s always good to give names to things, so right click on New Test_1 and Name it Distance.

1 Distance

2. Paste the following in to URI field.

http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false&avoid=highways&mode=bicycling Make sure Method is GET and then Commit and Send.

2 Send

3. In the Response section we interested in the distance. Unless Montreal and Toronto are floating apart, you should get 621 km at 1 day 8 hours. But at what speed? Select the tab Runtime Variables, then scroll down till you get the distance value field of 621476 (meters). Select this value number and right-clickAdd Variable Reference. Name it Distance. OK, Commit.

3 add vairable

4. In Tutorial 2 we used a SOAP calculate function, lets add that. Since SOAP comes with WSDL, just paste

http://www.html2xml.nl/Services/Calculator/Version1/Calculator.asmx?wsdl into the capture WSDL bar.

4. capture calc

5. Now on Divide_1right-click and Clone,  twice. Renaming the the first to KM and the second to Hours.

5 Clone

6. Select KM and we need to enter the response from distance in Meters, into a = and b= should be 1000, the response needs to go into hours. in a= right-click, [RV] Runtime Variable, New Custom Group, distance. Set b= to 1000. Then Commit and Send.

6 KM

7. In the Response tab,  select Runtime Variables, then Divide Result and right-click. Add Variable Reference and name it Distance_KM. Notice the tab shows Runtime Variables (1) now?

7 RV km

8. Lastly we need to divide that response by 20 km/h. Select Hours in the project tree, in a= right-click, Select [RV] Runtime Variable, Calculator.asmx, Distance_KM variable. then b=20. This should be the result we have being asked to model.

8 Hours

9. Switch to Run View and drag Hours test case under the DefaultGroup. We should name that our scenario.Notice that Distance and KM are known prerequisites and so get added automatically.

9 Run view

10. Make sure we use the Test Case Success Criteria as we have not captured a baseline and lets Log Fail Only. Make sure you not Publishing this to HP Quality Center Project. Commit and Run suite.

10. Run

Conclusion

You automatically placed into Real Run Monitor, but we talk about Report view and logs in next post. Save your project as Tut3.

You have just automated a test scenario of 3 unit tests across both REST and SOAP API’s that reside on different systems and at different locations (external) to your network. Yes you could have done this faster manually the first time, but we will look at ways to baseline and monitor as well as use this example for more locations or different speeds.

Comments? Please share any thoughts or provide feedback so others can learn.

Installing a SOAPSonar License Server

SOAPSonar comes in a per seat and floating license models. Floating license are popular for occasional users and offshore sharing as they allow SOAPSonar to be installed on as many users machines as you would like, and only counts concurrent users.

The license controller application is only used briefly on checking out of the license and checking the license back in. The instance of SOAPSonar still runs on the local machine. As such minimal “server” load and network is required. The license controller is in fact a small process that runs on a windows machine, which requires a static IP address. On my machine its says its using 20,000k of memory, about 33% of chrome and the entire file is only 4.2 MB.

1. To install the license Controller start by downloading it from here. Install this on your server with Admin Rights. Once installed, although I try keep this post up to date, please check immediately if this is the latest version.  To do this, run the license controller and select Updates, Check for Updates.

1. Check for updates

2. Make sure the the process is running and automatically starts on your server. If the service is unavailable, license will not be available to check in or out. Right-Click on the icon in your tray, and select Manage Licenses.

2. Process

3. Every server is fingerprinted, and your licenses tied to that server. Select File, Show Server ID, and copy this value. Send this FingerPrint ID to [email protected]

3. Show Server ID

4. Your license will then be generated by Crosscheck Networks for that server ID, and we will send you back your license key. Select File, Add Licence Key and paste your license. Select OK. Each group of licenses should now show as a line item.

4 Add key

5. Select File, Preferences, and confirm and on the License Server Settings tab, confirm your port number. Run cmd, then enter ipconfig to get your IP address. These are needed for users to connect to the server.

5 port and IP address

6. On the second tab, Client Installation Version Control, you can set the minimum or maximum version and the download location to ensure that your team uses the same release. This is helpful if you sharing projects.

Versioning

7. Statics offers a way for you to see which users use what licenses and how often. Enabling planning between seat and floating licenses.

7 Statistics

 8. On a workstation, download and install SOAPSonar. Its important to do this by right clicking on file and run as admin, for access to .Net libraries. Select Registration, Use License Server8 Check out

9. Enter the IP address and Port of your license server, Select Key Type and Request License.

9 connect

If you have any question, please just reach out to me.

 

 

 

 

 

 

SOAPSonar with HP Quality Center Integration

SOAPSonar is a HP Software Certified Application and provides native integration with HP Quality Center allowing test run information to be published directly into HP Quality Center. Tests can be run from either within a Quality Center project, or separately from the SOAPSonar console or command-line interface. SOAPSonar also provides an HP Quality Center console allowing browsing Test Instances, Test Sets, Defects, and Attachments. SOAPSonar projects can now be managed and stored directly within an HP Quality Center project. Read More

1. SOAPSonar – Installing and Getting Started

So new you new to SOAPSonar. Perhaps you joined a new team that uses it, a student,  or you downloaded a trial and trying to get started.   Here is a quick tutorial on the install and UI.

Installation

After downloading the latest version (request a no obligation 14 day trial here), install by right click and run as administrator. If you don’t install with Administrator rights, you should get warnings.

Once installed you should be presented with the registration screen. Please enter your name, company and email. If you are behind a web proxy, please first enter the proxy settings. These can be taken from your browser settings. Go, File, Settings and Preferences and select the Global Proxy Settings tab. enter your organizations proxy settings here before registering. Alternately you can select the Manual Activate button Option.

Proxy

If you doing and evaluation or your company uses Instance based licensing, enter your license key then select activate key.  Instance based licensing can only be loaded on one machine per license key.  Note if you using Instance based pricing, the number of days still on your license is shown.

Licenese

If your company uses Floating licenses centralized license server is used. The server is used to check-out or check back the license only and does not require persistent network access. Licenses server is only accessed at the time the lease is granted or released. The server is not a file server and need not be a dedicated machine, but requires a  static IP address and a small windows application. SOAPSonar can then be loaded onto as many machines as you would like, but only one machine can use a licensee at a time.  If you using floating licenses, select the button for Use License Server and enter the details.  (or hostname) and open port. Request New License Lease and select the Key Type and how long you wish to check the license out for.  Select Request License and if there is an available Floating license of the Key Type requested, SOAPSonar will activate.

License Server

The User Interface

UI

SOAPSonar UI follows the usual windows convention

  • File – File related tasks like new project, load project and save project with Settings and Preferences
  • Mode – SOAPSonar 4 pillars of QA (functional), Performance, Compliance, Vulnerability (security). Note the mode can also be changed in the right corner.
  • Tools – Various tools from key management to traffic capture.
  • Library – List of Automated Data Sources and vulnerability definitions that can be used.
  • Updates – To check for updates to the latest release. SOAPSonar does not require manual scripting. If manual scripts have not being used, upgrades should have no impact on test cases. It is highly recommended that you stay current to avoid known issues and get the new features.
  • Registration – Discussed above
  • Simulation – To launch a CLOUDPort generated run-time virtualized mock service to test against
  • Agents – For downloading and configuring remote performance load agents.
  • Help – Yes there is a help file.

Now each of the 4 pillars (QA, Performance, Compliance, Vulnerability) can be set to

  1. Project View – For the configuration of your Project Tree or Test Suite Groups for automating your testing.
  2. Run View – For running automated tests projects
  3. Report View – For those who actually want to see the results after a test is run.

Conclusion

You should now be ready to start testing. If you have a project and feeling ready, you can start that.

Else we are working on developing Tutorials. These will be very basic tutorials to highlight a few frequently used features that should not take more than a couple hours to complete.

PERFORMANCE TUNING MOBILE API – NETWORK

A mobile application by default has a network component. The portion from the phone to the Ethernet card of the API servers. Who has not seen the US commercials “can you hear me now?” Canadian Wireless Service providers spend significant effort to plan their network coverage, identify poor performance, do capacity planning and ensure signal coverage. This includes crowd sourcing, BI, using tools and even driving around. Wireless networks are however not static and everything from the number of tree leaves, to time of day, affect the signal strength and capacity for a given location (Wireless bandwidth is limited and shared per cell frequency and cell coverage). Add to this nearly 10,000,000 square km of geography we have in Canada and you can understand the enormity of testing the network.

Read More