Breaking News
yeni film izle hd film seyret film izle

Adding parameter values to a data table

In this, we will add two more departure cities to the data table, so that Quick Test can test the application with this data.
  1. Enter additional cities in departure column.
    Click row 2 in the departure column and add another city name. For example Portland Click row 3and add seattle. Press Enter.
  2. Save the test
    Select FILE> SAVE. Or click Save button.
Modifying steps affected by parameterization:
After parameterization of one step in a test, other test objects might be affected when the value of the parameterized step changes. If so, you must modify the expected values of those objects to match the value resulting from the parameterized step. In this, we will modify the text checkpoint so that when running the test, Quick test checks for the text that matches the current departure city.
    1. Locate the text checkpoint to modify.
      In this parameter test tree, expand (+) welcome: mercury> flight conformation.
      Right click checkpoint: New York and select checkpoint properties. The text checkpoint properties dialog box opens.
    2. Parameterize the text checkpoint.
      In the checked data area, New York is displayed in the constant box. New York is expected value for the checkpoint for every iteration.
      Click parameter.
      In the parameter name box, select departure. This instructs the checkpoint to use the departure parameter values in the data table for the expected results.
    Click ok. Note that the icon is now displayed beside the checkpoint. This indicates that the checkpoint is parameterized.

  1. Save the test.
    Select FILE> SAVE.
Running and analyzing parameterized test:
You can now run the modified parameter test. Quick Test will run the test for three times, once for each departure city in the data table. Each test run is called iteration.
    1. Run the parameter test.
      Click run on the Quick Test toolbar or choose TEST> RUN. The run dialog box opens. Select new results folder and accept the default results folder name. Click OK. When the test run is complete, the test results window opens.
    2. Examines the results summary.
      • Iteration 2
        In this results tree, expand (+) parameter iteration 2> action summary> welcome mercury> flight conformation.
      • The checkpoint results show that Portland was the expected result and the actual result. Therefore the checkpoint is passed.

      • Iteration 3
        In this results tree, expand (+) parameter iteration 3> action summary> welcome mercury> flight conformation
    • The checkpoint results show that seattle was the expected result and the actual result. Therefore the checkpoint is passed.
  1. Close the test result windows.
    Choose File> Exit to close the test results window.
Creating output values
In the previous section, we created parameters that inserted different data into each iteration of test run. You can also retrieve data from your application and output it to the data table using output values. This data can be used at later stage in the test. Quick test displays the retrieve data, following the test run, in the runtime data table. For example, you can use an output value to verify that the date or flight no. is correctly displayed in two different web pages, by using the value obtained in one page as the expected text that Quick Test checks in for other page.
Creating an output value
In this you will create an output value that retrieves the outbound fare from the select a flight page in each test iteration.
    1. Start Quick Test and open the parameter tests.
      If Quick test is not already open, choose START> PROGRAMS> QUICK TEST PROFESSIONAL> QUICK TEST PROFESSIONAL. Then choose, FILE> OPEN or click open button.
    2. Save the test as output
      Select FILE> SAVE AS. Save the test as output.
    3. Confirm that active screen option is enabled.
      If you don’t see the active screen on the right side of the Quick test window, click the active screen toolbar button, or choose VIEW> ACTIVE SCREEN.
    4. Select the text you want to use as an output value.
      In the test tree, expand (+) welcome: mercury and click select a flight page. This page is displayed in active screen. In this active screen, highlight the fare, without $ sign. Right click the highlighted text and select insert text output. The text output values properties dialog box opens.
    5. Set the output value option.
      The data table column name box displays select_a_flightoutput_text_out. Change this to depart_flight_price. Click ok to accept the other default settings. Quick test adds the depart_flight_price column to the data table.
    6. Modify the table checkpoint that checks the ticket price is displayed in the flight summary table.
      In the test tree, expand (+) welcome: mercury> book a flight. Right click checkpoint “New York to” and select checkpoint properties. The table checkpoint properties dialog box opens.
    1. Click column 3 in row 3 (the checked cell). In the check value as area, click parameter and the

depart_flight_price

    1.  from the parameter name box. Click

OK

    .

  1. Save the test.
    Select FILE>SAVE or click save button.
Running and analyzing a test with output values
Now we will run the test and examine the results.
  1. Run the output test.
    Click run on the Quick Test toolbar or choose TEST> RUN. The run dialog box opens. Select new results folder and accept the default results folder name. Click OK. When the test run is complete, the test results window opens.
  2. Examine the run time data results.
    In the test results window, select run time data from the results tree. The output values used during the test run are displayed in a grid. Note that a different price is shown in the depart_flight_price column for each iteration.
  3. Examine the checkpoint results.
    Choose view> expand all.
    In the output iteration 1 (row 1), under “book a flight” page, click checkpoint “New York to”. In the details pane, the checkpoint is marked in green as passed because the price of the ticket for the first flight in the summary table matched the expected value obtained from select a flight page. Examine the checkpoints for iteration 2 and 3 as well.
  4. Close the test results window.
    Choose file> exit to close the window.
Using regular expressions
We can use the regular expressions to increase the flexibility and acceptability of your tests.
Regular expression syntax
Regular expression enables Quick test to identify objects and text strings with varying values. You can use regular expressions when defining the properties of an object, the method of an arguments, when parameterize a step, and when creating checkpoints with varying values. A regular expression is a sting that specifies a complex search phase. By using special character such as a period (.)asterisk (*)caret (^), and brackets ([]).
Working with regular expressions
  1. Start Quick Test and open the recording tests.
    If Quick test is not already open, choose START> PROGRAMS> QUICK TEST PROFESSIONAL> QUICK TEST PROFESSIONAL. Then choose, FILE> OPEN or click open button.
  2. Save the test as Regular expression. Select FILE> SAVE AS. Save the test as parameter.
  3. Confirm that active screen option is enabled.
    If you don’t see the active screen on the right side of the Quick test window, click the active screen toolbar button, or choose VIEW> ACTIVE SCREEN.
  4. Select the text for which you will create the checkpoint.
    In the test tree, expand (+) welcome: mercury and click the select a flight page. The page is displayed in the active screen. In the active screen, scroll up and highlight the date, for the outbound flight. Right click the highlighted text and select insert text checkpoint. The text checkpoint properties dialog box opens.
  5. Enter the regular expression for the text you want to check.
    In the checked text area, click the edit constant options button. The constant value options dialog box opens.
    In value box replace the current date. This instructs Quick test to check that each character is selected text matches the number range format defined by regular expression. The expression checks for the following format:
    mm/dd/yyyy.
    Select the regular expression check box. A message prompts you to insert the backlash character before each special character. Click no. Click ok to accept other default settings and close the constant value options dialog box.
  6. Save the test.
    Select FILE> SAVE or click Save button.
Running and analyzing a test with regular expressions
  1. Run the regular expression test.
    Click run on the Quick Test toolbar or choose TEST> RUN. The run dialog box opens. Select new run results folder and accept the default results folder name. Click OK. When the test run is complete, the test results window opens.
  2. Examine the checkpoint results.
    In the results tree, expand (+) test regular expression summary> regular expression iteration 1 (row 1)> action summary> welcome: mercury> select a flight. The checkpoint passed because the text was displayed in the format specified by the regular expressions.
  3. Exit the test result window.
    Choose File> Exit to close the test result window.
Dividing tests into multiple actions
Actions divide your test into logical sections. When you create a new test, it contains one action. By dividing your tests in to multiple actions, you can design more modular and efficient tests.
Creating new actions
  1. Start Quick Test and open a new test.
    Choose START> PROGRAMS> QUICK TEST PROFESSIONAL> QUICK TEST PROFESSIONAL
  2. Start recording on the mercury tour website. Choose TEST> RECORD or click the RECORD button
  3. Login to mercury tours web site.
    In the user name and password boxes, type user name and password you registered with mercury tools. Click sign in
    The flight finder page opens.
  4. Enter flight details.
  5. Select a flight
    Click CONTINUE to accept the default flight selections. The book a flight page opens.
  6. Enter required passenger and purchase information. Enter the required information in passenger and credit card sections.
  7. Return the browser to the flight finder page. At the bottom of the flight conformation page, click back to flights button. The flight finder page opens.
  8. Stop recording
    In Quick test, click stop to stop the recording process.
  9. Save the test
    Select File> Save as.
Dividing the test into two actions
  1. Select the page where you want the second action begin in the test tree, expand (+) action 1> welcome: mercury.
  2. Split the test in to two actions.
    Select the find a flight page and choose step> split action or click the split action toolbar button. The split action dialog box opens.
  3. Enter the names and description for the two actions.
Inserting new action
  1. Insert the return home action.
    Choose Insert> New action or click the insert new action toolbar button. The insert new action dialog box opens. Enter return home in the name box, confirm that at the end of the test is selected and click OK.
  2. Prepare the application for recording.
    Confirm that your web browser is open to the flight finder page. Position the applications on your desktop so that you can see both Quick test and web browser.
  3. Change the record and run settings.
  4. Record the return home action.
    In the tree view, select the new return home action icon.
  5. Return the record and run settings to their original settings.
  6. Save the test
    Choose File> Save as

Check Also

Recording a Test Case

In the recording mode, QTP captures all the operations performed on the GUI. You need to work with …