So much for preamble, let’s get to work. If you followed along with part 1 of this series, you should already have an NOAA-Weather-Service project. We’ll continue with the same web service here. In our earlier test case; we used today’s date and the latitude and longitude for Silver Spring. In the NDFDgenByDay Request, the startDate must be a String in the format “yyyy-MM-dd”. The NOAA web service has a function that returns us the latitude and longitude when provided with a ZIP code. This time we will read the data we require for this functional test from a properties file.
Let’s remind ourselves of the steps to creating the Test in SoapUI:
1.Create a New Test Suite and a Test case.
2.Within the Test Suite setup script, if the properties file does not exists, write to a new properties file today’s date and the default ZIP code.
3.Create a Properties object and assign the values read from the properties file to it.
4.Within the test case setup script, read from the properties file.
5.Use the zipCode property from the above step in the LatLonListZipCode request, which will return the latitude and longitude to us.
6.Use Groovy to assert that we retrieved the correct ZIP code and transfer the latitude and longitude down the line.
7.The NDFDgenByDayLatLonList request now uses the date from the property step 1, and the latitude and longitude from step 6.
8.Lastly, use Groovy step to parsing the XML, validate the response, and assert the results.
1. Create a New Test Suite and Test Case. Follow these steps:
a. Right click on the project, and select the New TestSuite menu item. Specify the name WeatherTestSuite.
b. Right click on the Test Suite you created above and select the New TestCase menu item. Specify the name WeatherTestCase.