Mockup Tutorial

Script-less Tutorial Part 3 In this lesson we will build a simple test case based on a mockup. You can download the mockup that we will use in this lesson from the ZAPTEST Demo Page. Open the downloaded mockup in the image viewer. Let's add this mockup to the Object Repository. Click the Scan GUI button to scan the application; then click on the image viewer icon with the mockup image opened. Define a new application and a View as we did in the first lesson. Then remove all elements except labels, text boxes and the Registration button. As you already know, we should use relative objects for textboxes. If auto-anchoring is enabled during the scan, ZAPTEST will define relative objects automatically. Otherwise you will need to make the textboxes relative to their labels manually. To do this click the Select Relative Object button located in the object properties box for the First Name textbox object, then click on the First Name label. Now we have to do the same for the other three objects - LastName, Username, and Password text boxes. Next, we will change the Name for the textboxes by typing a new value in each object's Name property. Now we are ready to add test steps. Like we did before, we should first launch the browser application using the Launch method. Then, we will check if the page has been loaded by using the Exist method. And then, we will fill in the registration form using the Type method. We will define the DataTable parameters for each input; this gives us the ability to make multiple iterations in the future. Just for our convenience we will add the DataTable parameters for the browser name; it will give us the ability to do cross-browser testing. So now we have added four steps into our script that will fill in the registration form. The final element is to click on the Register button. But how do we check that the user is indeed registered since we only have one mockup view? For now, we can simply add a new object and set the text which would appear when the registration is successful. In addition, we can set the Text parameters for the objects within the script. We have a special method “ SetProperty”; It means that we can dynamically set a new value of the TEXT property. We can also use value from a variable or a DataTable parameter. Now, we should only apply the exist method to this object at the end of the registration process. We should also close the application at the end of the test case. In addition, we will include a Custom Reporting step which will report a failure to the test result; if for any reason the Registration page is not loaded. To do this, we will drag the application object to the FALSE path of our IF block and choose the CustomReport step. For the step arguments we will type FALSE to set the failed status, type step title, type step details, and type TRUE in the last argument to save the application's screenshot. Now, we will save our test case. Our test is ready, let’s run it! As you can see ZAPTEST has performed all of the operations against the real website. And it even verifies the registration status. Please visit to start using ZAPTEST today!

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227