CT Intro Training Test Creation 3 2198 KB

CloudTest Training Exercises

Test Creation Part 3

SOASTA Proprietary and Confidential 4/16/20

Copyright Notice

COPYRIGHT© 2013 SOASTA Inc. This document is unpublished and the foregoing notice is affixed to protect SOASTA Inc. in the event of inadvertent publication. All rights reserved. No part of this document may be reproduced in any form, including photocopying or transmission electronically to any computer, without prior written consent of SOASTA Inc. The information contained in this document is confidential and proprietary to SOASTA Inc. and may not be used or disclosed except as expressly authorized in writing by SOASTA Inc. Copyright protection includes material generated from our software programs displayed on the screen, such as icons, screen displays, and the like.

Trademarks

Technologies described herein are either covered by existing patents or patent applications are in progress. All brand and product names are trademarks or registered trademarks of their respective holders and are hereby acknowledged.

Confidentiality

The information in this document is subject to change without notice. This document contains information that is confidential and proprietary to SOASTA Inc. and may not be copied, published, or disclosed to others, or used for any purposes other than review, without written authorization of an officer of SOASTA Inc. Submission of this document does not represent a commitment to implement any portion of this specification in the products of the submitters.

Content Warranty

The information in this document is subject to change without notice. THIS DOCUMENT IS

PROVIDED "AS IS" AND SOASTA MAKES NO WARRANTY, EXPRESS, IMPLIED, OR

STATUTORY, INCLUDING BUT NOT LIMITED TO ALL WARRANTIES OF MERCHANTABILITY

OR FITNESS FOR A PARTICULAR PURPOSE. SOASTA Inc. shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance or use of this material.

Version

7

SOASTA Proprietary and Confidential 4/16/20

Exercise 1: Playback and Debugging

Objective

The objective for the following two exercises will be to ensure the student is able to successfully use the composition in general playback mode, debug mode, and inspect results.

Exercise A: Playback

Step

1. Click the Open in Test Composition icon on the Clip Editor toolbar.

2.

Click the Play button ( ) on the Composition Editor toolbar. The Composition Editor

Play tab appears with the default dashboard in display while the test composition plays.

3. The Result Details dashboard appears with the status Playing. The Result Details dashboard helps you determine the cause of errors in your test and has several methods for navigating through the test results. Start by clicking the grey triangles next to the

Track and Clip names to expand each Page in the test. You can further expand individual Pages to see individual message requests.

4. The Navigation Tree view on the left is useful for navigating around multiple clips in a test composition. Click the arrow for any node to expand or collapse it.

SOASTA Proprietary and Confidential 1 4/16/20

5. Click the first page in the navigation page on the left (soastastore.com Home Page).

The dark-blue icon on the right ( ) represents the page. The data below the cover flow shows statistics associated with the playback of this page during the test. Click the brown “GET” icon to the right of the page and the Input Output tab.

6. Repeat steps 1-4 above for each of the pages in this test. Make sure the response content in the first GET (or POST) request of each page contains the expected information. Pay special attention to all POST requests and the GET requests that immediately follow the POST requests. This is where most correlation and parameterization errors typically occur.

SOASTA Proprietary and Confidential 2 4/16/20

End of Day Optional Checkout Exercise: Record, Convert, STWP, and

Playback

Objective

The objective for the following optional exercise is to tie back the student’s understanding of all the topics covered thus far.

Exercise: Record, Convert, STWP, and Playback

Step Optional Exercise

1. Record the following steps: a.) www.soastastore.com

b.) Search for a book (i.e “Vegas”) c.) Select book link d.) Select Add To Cart e.) Select the Checkout Link f.) Update Quantity to 5 g.) Enter in all required fields and select Purchase

2. Convert the Clip

3. Launch STPW and correlate the book link on the third page

4. Playback the clip and ensure everything is in working order. Save the clip as “Optional

Checkout Exercise – yourname”.

Exercise 2: Seed Data

Objective

The objective for the following exercise will be to ensure the student is able to successfully create and use the Seed Data feature.

Exercise:

Step

1. Open the clip from Exercise 7 and save it as Exercise 8.

2. Create a seed data object for usernames using the seed data editor and name the Seed Data

“Usernames”. (You may choose to either import a CSV or manually enter in the usernames in the editor). Create 5 records with the following users:

SOASTA Proprietary and Confidential 3 4/16/20

3.

Create a new property called “Username” and point it to the Seed Data object created in

Step 1. Keep all the defaults for now.

4. Parameterize the clip for the new “Username” property by replacing hard-coded testuser1 with the seed data property path.

SOASTA Proprietary and Confidential 4 4/16/20

Exercise 3: Session Template Wizard (Correlation)

Objective

The objective for the following exercise will be to finish correlating the remaining values using both the Session Template Wizard and by creating manual property sets (correlations). The goal of this exercise will be to ensure the student is aware of the activities that occur when leveraging the Session Template Package Wizard and/or the Session Template Wizard.

Exercise:

Step

1. Within the Clip Editor, expand the grey triangle next to the pages for posting a new forum topic and the page immediately after that one. The URL request after the post is hard-coded to something like /post-1/ or /post-1-1/.

2. The next step is figuring out where the /post-1/ value comes from and correlating it. To correlate a single property in the test, we will use the Session Template Wizard that is accessed from within the test clip editor. Note that this is a different wizard from the

Session Template Package Wizard we used earlier in the tutorial since we’re only focusing on a single property. Highlight the portion of the Query String you want to correlate. In this case, just highlight the entire Query String field. With the text highlighted, click the session template icon ( ) in the upper-right corner of the clip editor and choose “Launch Session Template Wizard”.

3. The “Value Search and Retrieval” window will appear.

SOASTA Proprietary and Confidential 5 4/16/20

4. Click the “Find” button. This will search from the current message back to the front of the test. It will find the occurrence of this value in a response that preceded the selected message.

5. This string was found in the Location header of the response to the index.php (4) request. This is the page that POSTs the new topic. If you click the Next button repeatedly, it will search through the recorded responses of the clip to identify other locations where this string was returned in a response. This clip has a few places where this string was found.

SOASTA Proprietary and Confidential 6 4/16/20

6. Select the first recorded response, index.php (4). For this extraction, use a SubString.

Click the “Edit” button next to the SubString option.

7. The string you want to extract is coming back in the Location header of the response.

The Header name has been pre-populated for you. Select the appropriate leading and trailing text values to extract the orange text and insert them into the appropriate fields. Click the “Test” button to verify the extraction works correctly. Click OK when done.

SOASTA Proprietary and Confidential 7 4/16/20

8. The SubString Parser window will close and you are returned to the wizard. Click the green arrow on the right of the wizard to move to the next step.

9. In this step you will define where you want the extracted data stored. You can either store the data in a new property or reuse an existing property. If you want to reuse an existing property from a previous correlation, you can do that, but be very careful as reusing properties can have unintended consequences when variable contents change.

Since you are correlating this value for the first time, you want to create a new clip custom property. Give it the name of page_id. It is recommended that you use new properties to avoid any contention issues.

10. Click the green arrow on the right of the wizard to move to the next step.

11. Click the “Find All” button.

SOASTA Proprietary and Confidential 8 4/16/20

12. Select each of the checkboxes for the requests you want the wizard to replace. In most cases, you will choose the top checkbox to select all of the values to be replaced with the dynamic property. Click the top checkbox to select all values to be replaced.

13. Click the green arrow on the right of the wizard to move to the next step.

SOASTA Proprietary and Confidential 9 4/16/20

Enter a name for this Session Template, page_id, click Browse… if you want to save to a specific location and click OK to close the wizard. After the wizard closes, the test clip will be reloaded with the new changes.

14. Review of what the STW did:

An extraction rule was defined (e.g. property set)

A clip property was created

The static string that needed to be correlated was replaced with a dynamic property

 A “session template” was created for re-use in other test clips (reusable session templates is a topic beyond the scope of this tutorial, please see

CloudLink for more information)

SOASTA Proprietary and Confidential 10 4/16/20

Exercise 4: Find & Replace

Objective

The objective for the following exercise will be to ensure the student is able to successfully create a JavaScript and use the script successfully.

Exercise:

Step

1. From the Central tab, right-click on your clip and select “Find and Replace”.

2. Enter “topicid” in the top field and click the “Find All” button.

3. Create a new property for the random integer (“RandomNumber”)

4. Use the random integer at the end of your topic name

SOASTA Proprietary and Confidential 11 4/16/20

Exercise 5: Correlations Continued

Objective

The objective for the following exercise is to finish all correlations for the Soasta Store Clip

Exercise:

Step

1. There are still more correlations you need to complete before the test is working correctly.

Use a combination, if necessary, of the methods described above to complete the remaining correlations (Session Template Package Wizard or Session Template Wizard). You will need to correlate the following name/value pairs:

 topicslug

 topicid (topicid is used in the POST message that replies to the forum topic)

Exercise 6: JavaScript

Objective

The objective for the following exercise will be to ensure the student is able to successfully create a JavaScript and use the script successfully.

Exercise:

Step

1. Open the clip from Exercise 9 and save it as Exercise 10

2. Create a JavaScript that will create a random integer (function are provided below). function generateRandomNumber(lowerExtreme, upperExtreme) { return Math.floor(Math.random() * (upperExtreme - lowerExtreme) + lowerExtreme);

} var num = "" + generateRandomNumber(100,500);

$prop.set("MessageClip", "RandomNumber", num);

$context.result.postMessage($context.result.LEVEL_INFO, "Random Number is: " + num);

3. Create a new property for the random integer (“RandomNumber”)

4. Use the random integer at the end of your topic name

SOASTA Proprietary and Confidential 12 4/16/20

Exercise 7: Data Generation

Objective

The objective for the following exercise will be to ensure the student is able to create a random strong property based on the Data Generation functionality in CloudTest.

Exercise:

Step

1. Within your Clip, open the Properties tab and navigate to the Clip Custom Properties

2. Title the Property name “RandomString” and select Generated Value as the Value type.

3. Options appear for Date, Number, and String. Select the String button.

4. Select Random, and enter “10” for the length of the string.

5. Select Alpha from the list of String types

6. Use the RandomString property as the text response for the Reply to Post step in the

Soasta Store Forum scenario.

Exercise 8: Transactions

Objective

The objective for the following exercise will be to ensure the student is able to successfully create transactions.

SOASTA Proprietary and Confidential 13 4/16/20

Exercise:

Step

1. You will create a transaction that includes loading the SOASTAStore.com home page, loading the Forum default page, logging in, and loading the Forum default page after login.

Start by multi-selecting these pages and think times (delays) in the test clip

2. Right-click on the highlighted area and choose “Create a Transaction” from the menu.

3. A transaction with a default name of “Transaction1” has been created.

4. Rename the transaction to Access and login to Forum, like you would rename a page.

5. Repeat this process, as desired, to add additional transactions to this test clip.

6. Save the test clip

7. Transaction-based metrics will now be available in the CloudTest dashboards. Here is the

Result Details Dashboard with transactions

SOASTA Proprietary and Confidential 14 4/16/20

Exercise 9: Comments

Objective

The objective for the following exercise will be to ensure the student is able to successfully insert comments into clips

Exercise:

Step

1. Within your clip, select the first page.

2. From the Clip Editor toolbar, select Add Comment.

3. A blank comment will be inserted after the page that was selected.

4. Enter text for the comment: “The user has navigated to the homepage”.

SOASTA Proprietary and Confidential 15 4/16/20

5. As in a text editor, pressing Return starts a new line in the comment. When there is no selection, or another clip element in the test clip is selected, the blue border is replaced by a gray border around the comment. When the comment is selected it can be dragged and dropped into a new location just as with any other clip element.

6. Create other comments as needed, to explain what is happening in the clip

Exercise 10: Validations

Objective

The objective for the following exercise will be to ensure the student is able to successfully create validations.

Exercise:

Step

1. Double-click the homepage and navigate to the validations section. Click the green plus sign

( ) in the area on the right to add a user-defined validation.

2. Create a Validation on Homepage for the Key Phrase “Scalable, Affordable Testing of Web

Apps”. Also add a result success/error message.

SOASTA Proprietary and Confidential 16 4/16/20

3. Create a second Validation on Login for the Key Phrase “Logged in as”. Also add a result success/error message.

4. Click Save in the Clip Editor toolbar

5. Run the clip to ensure validations are working correctly

Advanced Exercise: Random Forum Selection

Objective

The objective for the following exercise will be to ensure the student is able to successfully apply knowledge from the course.

Exercise: Random Forum Selection

Step Random Forum Selection

1. Update your clip from Exercise 12 to randomly pick from one of the four available forums.

SOASTA Proprietary and Confidential 17 4/16/20

2. Next have your clip add a new topic and reply to the post to the randomly selected Forum from Step 1.

HINT: This will require updates to two other variables in your clip. Use one of the three methods you have learned to correlate these two values.

Exercise 11: Recording within the Clip Exercise

Objective

The objective for the following exercise will be to walk through the option of recording within the clip

Exercise:

Step

1. Verify the Conductor is running

2.

Go to Central list > Clip and then click New Clip appears.

in the toolbar. The Clip Editor

3. Click the Record drop-down botton and choose the Record HTTP option

SOASTA Proprietary and Confidential 18 4/16/20

4. The Choose a Conductor screen will appear. In the Available Conductors list, select the

Conductor launched (in Step 1 above)

5. Ensure that your SOASTA Conductor status is “connected”. If your SOASTA Conductor is not connected, the following steps will not work. Verify the Conductor connection settings and restart it.

6. Click the Record button on the Choose a Conductor screen. The clip editor should now be in listening mode, and ready to record. The Record button should be lit up.

7. Open http://www.soastastore.com/ in the second browser.

SOASTA Proprietary and Confidential 19 4/16/20

8. Messages start to appear in the clip editor.

9. Record the Soasta Store Checkout Scenario: a.) Search for a book (i.e “Vegas”) b.) Select book link c.) Select Add To Cart d.) Select the Checkout Link e.) Update Quantity to 2

Enter in all required fields and select Purchase

10. Return to the first browser, with the clip editor open, and click the Record button when you've finished your scenario. The Record button should no longer be lit.

Exercise B: Inspecting and Filtering Your Recording

Step

1. Once the recording is finished, review the HTTP(S) messages that were recorded and verify the recording looks accurate and complete. When scrolling left or right, messages are dynamically loaded in the clip editor.

2. Click the Message/Actions tab in the lower left-hand corner. In the center column of this tab, all the targets created for this scenario are listed. Remove a target by right clicking on the target and selecting ‘Remove Target’. All targets except ‘www.soastastore.com’ should be removed.

3. The clip is now ready for additional customization (correlations, parameterization, etc.)

SOASTA Proprietary and Confidential 20 4/16/20