SlideShare una empresa de Scribd logo
1 de 29
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   Exercise 6. Test a Web Application

          What this exercise is about
                                  In this lab, you will create and execute component tests on a Web
                                  application. The first test case focuses on the Java classes within the
                                  application. The second test case treats the entire Web application as
                                  one component. You will record and play back HTTP messages to test
                                  the Web application’s behavior.


          What you should be able to do
                                  At the end of the lab, you should be able to:
                                   • Create a test project and test suite to hold test artifacts
                                   • Create a JUnitTest
                                   • Capture HTTP messages using HTTP Recording
                                   • Configure a URL Test Suite to test Web application components
                                   • Execute a URL Test Suite against a Web application


          Introduction
                                  The automated component test features available in the IBM Rational
                                  Developer (V7 and later) products help you find defects easily,
                                  improving the overall quality of Java and J2EE applications. The
                                  component test capabilities provide an end-to-end test solution by
                                  allowing you to create, edit, run, and view results for tests. Tests also
                                  facilitate the reuse of test suites. This feature allows tests to be used
                                  throughout the development process.
                                  This exercise highlights how to use the automated component testing
                                  features available with Rational Application Developer. Following the
                                  library case study, you will create two types of tests: a Java application
                                  test and a URL application test. In the Java test case, you will test the
                                  model classes in the LibraryUtility Java application. Examine the
                                  behavior of the item and patron objects as you perform routine
                                  operations. The second test examines the LibraryWeb Web
                                  application as a whole. Record and playback HTTP messages to
                                  determine whether the application is functioning properly.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application       6-1
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



Requirements
                        Before starting this lab, you must complete the library database set up
                        from Exercise 1. Develop a Java Application. You must also set up
                        the LibraryWeb Web project according to the instructions in Exercise
                        3.
                        This exercise requires several code fragments and files. Make sure
                        that these files appear in the <LAB_FILES>Test directory before
                        starting the lab.

            Warning

This lab is very sensitive to firewall, proxy, and intrusion detection software.



Instructor exercise overview
This lab focuses on two types of test: Java and URL test. Developers should use Java
component tests to exercise Java applications and Java classes within a project. As a Java
application itself, Java tests do not need to run in an application server. As such, the library
application itself must switch from using the JDBC data source to direct JDBC calls in the
first test suite. Students modify the properties file to alter the behavior of the DriverManager
class. The library application was designed to support a range of data access methods.
The second type of test treats the entire Web application as one component. URL test
cases replay recorded HTTP messages. Its support will appear more rudimentary than the
other types of component tests. Students need to work through a series of steps to
configure a URL application test. Unlike the Java application test, there is no view to
determine whether a test case passed or failed, except for checking the HTTP status code.
Make sure that students stop the integrated test environment before running the Java
component test. The library database does not allow concurrent access; this is the
behavior of the Cloudscape database as configured through the steps in the Lab Set Up
guide. The test case will not be able to access the library database and it will fail.
If derby.jar is not added to LibraryTest project’s build path, the students will get a
NullPointer exception when they try to access the database - as a connection cannot be
created.




6-2   Developing Web Applications                                                 © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   Exercise instructions
          Preface
          The lab exercises in this course are designed to run in sequence. If you have skipped one
          of the previous labs, you must follow the steps in Appendix A before starting this
          lab.
          The following references in the exercise instructions represent directory locations in your
          workstation:
                   • <LAB_FILES>: C:LabFiles70
                   • <SDP_DIR>: c:IBMSDP70




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application       6-3
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



6.1. Create a Test Project
Before you can create a component test case, you need a Java project to hold the test
cases and test run results. Enable the component test capability to reveal the Test wizard
and perspective. Run the component test project wizard to create a new test project.
__ 1. Switch to the Test perspective.
      __ a. Select Window Open Perspective Other Test from the main menu.
            (Note that you may have to select the Show all check box in the Open
            Perspective dialog.)
      __ b. Click OK to Confirm Enablement.
__ 2. Create a Java project named LibraryTest to hold test cases and test run results.
      __ a. From the main menu, select File               New       Project.
      __ b. In the New Project wizard, select Java Project. Click Next.
      __ c. Type LibraryTest for the Project name.
      __ d. Click Finish. If prompted, do not switch to the Java perspective.
__ 3. Create tests and assets folders in LibraryTest to organize the artifacts you will
      create in this exercise.
      __ a. Right-click LibraryTest and select New                 Folder. Type tests as the Folder
            name.
      __ b. Click Finish.
      __ c. Right-click LibraryTest and select New                 Folder. Type assets as the Folder
            name.
      __ d. Click Finish.
__ 4. Add LibraryUtility to the Build Path of LibraryTest. This will allow the tests to
      access the classes in that project.
      __ a. Right-click LibraryTest and select Properties                  Java Build Path.
      __ b. In the Properties for LibraryTest dialog, select the Projects tab and click Add.
      __ c. In the Required Project Selection dialog, select LibraryUtility and click OK.




6-4    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ d. Click OK.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application       6-5
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



6.2. Create a JUnit Test
Create a JUnit test to exercise the Patron Java class. JUnit tests treat one or more Java
classes as a unit of test.
__ 5. Create a TPTP JUnit Test in the Test perspective.
      __ a. Switch to the Test perspective. You can either click Test in the perspective
            toolbar or select Window Open Perspective Other from the main menu
            and select Test.
      __ b. In the Test Navigator, right-click LibraryTest and select New                      Test Element
               TPTP JUnit Test.
      __ c. Click Next. Click Yes if you are prompted to add libraries to the build path.
      __ d. In the New JUnit Test Definition dialog, enter the following:
               - Package: com.ibm.library.testing
               - Name: PatronTest




      __ e. Click Next.
      __ f.   On the next page, select LibraryTest/tests as the location of the new test.
      __ g. Click Finish.

6-6    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   __ 6. Add test methods findByEmail and getAllPatrons to the PatronTest.
              __ a. In the Test Editor, click the Test Methods tab.




              __ b. Click Add and type findByEmail for the Name.
              __ c. Click Add again and type getAllPatrons for the Name.




                      Note

          With JUnit, the test methods name would usually have the prefix test. However you do not
          need to prefix the test method names in this tool.



          __ 7. Add behavior to the Patron Test, to invoke findByEmail and getAllPatrons.
              __ a. In the Test Editor, click the Behavior tab.
              __ b. Click Add        Loop. Keep the iterations at 1.
              __ c. Click Add        Invocation and double-click findByEmail.
              __ d. Select Loop1, as the following invocation will be a child of it.
              __ e. Click Add        Invocation and double-click getAllPatrons.

          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application       6-7
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


      __ f.   Save all your changes.




6-8    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   6.3. Edit the PatronTest Test Case
          The Test wizard created the PatronTest test case. You added two methods to this test case
          in the test editor: findByEmail and getAllPatrons. You will now implement the
          methods.
          __ 8. Open the behavior class(PatronTest) and add a patron field
              __ a. Press CTRL+SHIFT+R to open the Open Resource dialog.
              __ b. Type patron in the search field, and double-click PatronTest.java.




              __ c. Add the following field declaration on the line after the class declaration
                      public class PatronTest extends HyadesTestCase {
                         private Patron patron;
              __ d. Use Source         Organize Imports to import the Patron class.
          __ 9. Replace the FindByEmail and getAllPatrons methods. You can cut and paste
                from <LABROOT>/Test/snippets/snippet-1.txt
                  public void findByEmail() throws Exception {
                     patron = Patron.findByEmail("jb@bogus.ibm.com");
                     assertEquals("Jim", p.getFirstName());
                  }

                  public void getAllPatrons() throws Exception {
                     Collection<Patron> patrons = null;

          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application       6-9
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


            patrons = Patron.getAllPatrons();
            assertTrue(patrons.size() == 99);
        }
__ 10. Use Source            Organize Imports to import java.util.Collection. Save your changes.




6-10 Developing Web Applications                                                   © Copyright IBM Corp. 2004, 2007
                              Course materials may not be reproduced in whole or in part
                                     without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   6.4. Use a JDBC Connection Instead of a Data Source
          The classes in LibraryUtility use the DriverManager class to establish connections to a
          database. However, data sources are not normally available to Java applications. In order
          to test the database functionalities in a plain Java™ Virtual Machine (JVM), the connection
          method must be temporarily changed to a JDBC connection.
          The Library application supports a variety of data access methods. Change the
          databaseInformation.properties file to switch the access method from a data source to
          direct JDBC calls.
          __ 11. Stop the server before continuing, in order to free the lock on the
                 databaseinformation.properties file.
              __ a. In the Servers view, right-click WebSphere Application Server v6.1 and select
                    Stop.
          __ 12. Make a backup copy of the existing properties file.
              __ a. Switch to the J2EE perspective.
              __ b. In the Project Explorer view, right-click LibraryUtility
                       databaseInformation.properties file and select Refactor                          Rename.
              __ c. Change the name to databaseInformationBACKUP.properties.
              __ d. Click OK.
          __ 13. Copy the JDBC Connection properties to databaseInformation.properties.
              __ a. In the Project Explorer view, select databaseInformationJDBC.properties.
              __ b. Press CTRL+C and then press CTRL+V.
              __ c. In the Name Conflict dialog, change the name to
                    databaseInformation.properties.
              __ d. Click OK.
          __ 14. Add the Derby database JAR, derby.jar, to the project build path of LibraryTest.
              __ a. Right-click the LibraryTest Java project in the Project Explorer view, and select
                    Properties in the pop-up menu.
              __ b. In the Properties dialog, select Java Build Path in the left pane, and select the
                    Libraries tab on the right pane.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-11
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ c. Click Add External JARs, and browse to
          <SDP_DIR>runtimesbase_v61derbylibderby.jar.




    __ d. Click OK.




6-12 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   6.5. Run the Component Tests
          At this point, you have a Java test case. The JavaUtility classes no longer depend on the
          JDBC data source provided by the server to connect to the library database. Run the test
          cases against the library application and examine the results from the test.

                      Warning

          Firewalls, proxies, and intrusion detection software can interfere with the communication
          between Rational Application Developer and IBM® Rational® Agent Controller.
          Here are some possible issues:
                   • Your computer configuration uses a proxy in your Web browser. Rational
                     Application Developer may indicate compatibility issues. You may need to
                     disable your proxy during this lab.
                   • Your computer configuration uses intrusion detection software. The software
                     may block Rational Application Developer from writing results to the local file
                     system. You may see the following error when you run tests: No location
                     specified.
                   • You create a new IBM® WebSphere® Application Server profile using the
                     Typical profile creation setting in the Profile Management Tool. The server is
                     added as a Windows service. Rational Application Developer will try to start
                     Agent Controller as a service as well. This will fail if you did not, as a separate
                     task, install Agent Controller as a Windows service.



          __ 15. The LibraryUtility Java project needs direct access to the library database. If you
                 have not already done so, stop the server in order to close the JDBC connection to
                 the database.
              __ a. From the Servers view, select WebSphere Application Server v6.1.
              __ b. If the server is running, click the Stop the server button from the view toolbar.
              __ c. Wait until the server stops and verify that the server Status is Stopped.




          __ 16. Run the PatronTest.
              __ a. Switch to the Test perspective. You can either click Test in the perspective
                    toolbar or select Window Open Perspective Other from the main menu
                    and select Test.

          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-13
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ b. In the Test Navigator, right-click LibraryTest                  tests       PatronTest and select
          Run As Test from the main menu.

            Note

You can also select Run As Run and configure some options for your launch
configuration.



__ 17. Examine the results of the test case execution.
    __ a. Double-click the LibraryTest PatronTest[Timestamp] test result.
    __ b. In the Test Log, look at the Verdict field.




    __ c. Click the Events tab and expand the events.




6-14 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ d. Click on the fail node for getAllPatrons, and notice that the assertion failed
                    because of the wrong number of patrons.




                      Note

          If both test executions fail, there may be a problem connecting to the database. Usually the
          error will be a NullPointerException. This is because the persistence layer is unable
          to create a connection to the database and returns null instead.
          Several problems could have occurred:
                   • The LibraryUtility       databaseInformation.properties file has invalid settings.
                   • The file derby.jar was not added to the LibraryTest Build Path and a
                     ClassNotFoundException was thrown that resulted in a null connection.
                   • The server, the Data perspective, or some other process is connected to the
                     database.
          If the preceding hints do not resolve the problem, add method breakpoints at the beginning
          of the findByEmail and getAllPatrons methods. In the Test Navigator, right-click
          LibraryTest tests        PatronTest and select Debug As Test from the main menu.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-15
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



6.6. Restore the Data source Connection
When you are done with the component test, you need to restore the connection for
DriverManager back to using the data source.
__ 18. Delete the existing database properties file.
    __ a. In the Project Explorer view, right-click the LibraryUtility
             databaseInformation.properties file and select Delete.
    __ b. Click Yes to the confirm delete dialog.
__ 19. Rename the original database properties file back to its original file name.
    __ a. Right-click on the databaseInformationBACKUP.properties file and select
          Refactor Rename.
    __ b. In the Refactor Rename dialog, enter databaseInformation.properties
          as the new file name.
    __ c. Click OK to accept the new name.




6-16 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                    Instructor Exercises Guide



EXempty   6.7. Record an URL Test Case
          The component testing framework in Rational Application Developer also supports Web
          application testing. In order to test a Web application, you must capture a HTTP request
          message and play it back under test conditions.
          In this section, record your interaction with the patron item search servlet through the
          search.jsp page.

                      Warning

          If your computer configuration uses a proxy in your Web browser, Rational Application
          Developer may indicate compatibility issues. You may need to disable your proxy during
          this lab. However you may then need to switch to communicating to the server via SOAP.
          To do so, in the Servers view, double-click the test server, and click SOAP in the Server
          connection type and admin port area.
          If you computer configuration uses intrusion detection software, it may block Rational
          Application Developer from writing results to the local file system. You may see the
          following error when you run tests: No location specified.



          __ 20. Switch to the Test perspective.
          __ 21. Create a Recorder Artifact.
              __ a. In the Test Navigator view, right-click LibraryTest, and select New                         Test
                    Element Recording HTTP Recording.
              __ b. In the HTTP Recording dialog, select the LibraryTest                           tests folder.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application      6-17
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ c. Change the Recording file name to LibraryHTTPRecording.rec.




    __ d. Click Finish. This will open an external Web browser.
__ 22. Start the server.
    __ a. Open the Servers view by selecting Window Show View Other from the
          main menu, and then select Server Servers from the Show View dialog.
    __ b. In the Servers view, right-click WebSphere Application Server V6.1 and select
          Start.
    __ c. Wait until the server status is Started.
__ 23. Browse the library project from the external Web browser that opened automatically
       when you created the recording. Your actions will be recorded by the tool.
    __ a. In the browser address bar, enter
          http://localhost:9080/Library/search.jsp. Click Enter.




6-18 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ b. Enter abc@ibm.com in the Search Phrase text box and select the Email radio
                    button. Click Search.




              __ c. The no result page should display. Click Go Back to the Search Page.




              __ d. Back on the search page, enter 4 in the Search Phrase and select Patron ID as
                    the Criteria. Click Search.




              __ e. The list items page should now show up indicating a successful search.




              __ f.   Close the browser.


          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-19
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


__ 24. Customize the HTTP Recording.
    __ a. LibraryHTTPRecording should automatically be loaded into the editor once the
          external browser closes. Switch to the Behavior tab of the editor.
    __ b. Select Loop 1 in the Behavior column.
    __ c. Enter 10 in the Number of Iterations field.




    __ d. Save the changes.




6-20 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   6.8. Generate Executable URL Test
          The LibraryHTTPRecording Test Suite stores the HTTP messages captured by the
          recorder. To playback the captured HTTP messages, generate executable URL tests from
          the URL test suite.
          __ 25. Generate a Java class that executes the URL test.
              __ a. In the Test Navigator view, expand LibraryTest                     tests.
              __ b. Right-click LibraryHTTPRecording and select Generate.




              __ c. In the TPTP URL (JUnit) Test Definition Code Generation dialog, set
                    /LibraryTest as the Source Folder. Click Finish.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-21
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



6.9. Create a Deployment File for the Test Suite
The deployment file test artifact specifies which test suite and test cases belong to the
HTTP test. Use the test artifact wizard to create a deployment file and associate the HTTP
test suite to the file.
__ 26. Create a Deployment file for LibraryHTTPRecording.
    __ a. In the Test Navigator view, right-click LibraryTest                    New      Test Element.
          Select Test Assets Deployment. Click Next.
    __ b. In the New Deployment dialog, select LibraryTest Test Suite assets as
          the parent folder, and enter LibraryHTTPDeploy as the Name.




    __ c. Click Next.
    __ d. On the description page, click Next.
    __ e. In the define artifacts page, click Add.




6-22 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ f.   In the Add Artifact Association dialog, select Create a new resource, click
                      Next.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-23
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ g. Select LibraryTest assets as the parent folder and enter
          LibraryHTTPArtifact as the Name. Click Next.




    __ h. In the description page, click Next.




6-24 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ i.   In the define test assets page, select LibraryHTTPRecording.testsuite. Click
                      Finish.




              __ j.   Back to the New Deployment dialog, LibraryHTTPArtifact should now be
                      shown in the list.




              __ k. Click Next.
          __ 27. Create a new location test artifact to hold test case data associated with the HTTP
                 test suite.
              __ a. In the define locations page, click Add to bring up the Add Location
                    Association dialog.
              __ b. In the Add Location Association dialog, select Create new resource, then
                    click Next.


          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-25
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ c. In the define file resource page, select LibraryTest assets as the parent
          folder and enter LibraryHTTPLocation as the Name.




    __ d. Click Finish.




6-26 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ e. Back in the location page of the New Deployment dialog,
                    LibraryHTTPLocation should now be shown in the list.




              __ f.   Click Next.
              __ g. In the define mapping page, select LibraryHTTPArtifact on the left and
                    LibraryHTTPLocation on the right, then click the down arrow to add the
                    mapping to the list below.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-27
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ h. Click Finish.




6-28 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   6.10. Run the URL Test
          With all of the HTTP test suite artifacts created, you can now run the URL test suite. Create
          a launch configuration to specify which URL test case to run. Execute the URL test and
          examine the results, written to in the LibraryTest project.
          __ 28. Run the URL test.
              __ a. Right-click LibraryTest           tests      LibraryHTTPRecording and select Run As
                      Test.

                      Note

          You can also select Run As Run and configure some options for your launch
          configuration.



          __ 29. Once the URL test finishes, examine the test results.
              __ a. Double-click LibraryTest             LibraryHTTPRecording.
              __ b. Expand Loop, Page, and invocation to examine individual results.




          End of exercise




          © Copyright IBM Corp. 2004, 2007                                       Exercise 6. Test a Web Application     6-29
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.

Más contenido relacionado

La actualidad más candente

Hrishikesh_iitg_internship_report
Hrishikesh_iitg_internship_reportHrishikesh_iitg_internship_report
Hrishikesh_iitg_internship_reportHrishikesh Malakar
 
Agile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersAgile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersClever Moe
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Clemens Reijnen
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadDurga Prasad
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewSteve Lange
 
Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeJosiah Renaudin
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4Kuntal Bhowmick
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testingAdam Stephensen
 
Automation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadAutomation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadDurga Prasad
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4Billie Berzinskas
 
EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1Haytham Ghandour
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Hazem Saleh
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
 
Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.combigclasses.com
 
Installing and Deploying TestMaker 6
Installing and Deploying TestMaker 6Installing and Deploying TestMaker 6
Installing and Deploying TestMaker 6Clever Moe
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for AndroidHazem Saleh
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010Ed Blankenship
 
Tccc10 tooling testingci-vs2010teamcity
Tccc10 tooling testingci-vs2010teamcityTccc10 tooling testingci-vs2010teamcity
Tccc10 tooling testingci-vs2010teamcityBaskin Tapkan
 

La actualidad más candente (20)

Hrishikesh_iitg_internship_report
Hrishikesh_iitg_internship_reportHrishikesh_iitg_internship_report
Hrishikesh_iitg_internship_report
 
Agile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersAgile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business Managers
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in Hyderabad
 
70 499
70 49970 499
70 499
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
 
Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution Time
 
Test Management in TeamForge
Test Management in TeamForgeTest Management in TeamForge
Test Management in TeamForge
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
Automation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadAutomation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabad
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4
 
EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)
 
Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.com
 
Installing and Deploying TestMaker 6
Installing and Deploying TestMaker 6Installing and Deploying TestMaker 6
Installing and Deploying TestMaker 6
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010
 
Tccc10 tooling testingci-vs2010teamcity
Tccc10 tooling testingci-vs2010teamcityTccc10 tooling testingci-vs2010teamcity
Tccc10 tooling testingci-vs2010teamcity
 

Destacado

Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web developmentalice yang
 
Experience Report in #DEWT5: Where is test strategy with an agile team
Experience Report in #DEWT5: Where is test strategy with an agile teamExperience Report in #DEWT5: Where is test strategy with an agile team
Experience Report in #DEWT5: Where is test strategy with an agile teamMaaret Pyhäjärvi
 
Methods to test an e-learning Web application.
Methods to test an e-learning Web application.Methods to test an e-learning Web application.
Methods to test an e-learning Web application.telss09
 
Testing Web Application Security
Testing Web Application SecurityTesting Web Application Security
Testing Web Application SecurityTed Husted
 
Database Web Application User Test 2
Database Web Application User Test 2Database Web Application User Test 2
Database Web Application User Test 2Tim Broadwater
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updatedTharinda Liyanage
 
The Three Pillars Approach to Your Agile Test Strategy
The Three Pillars Approach to Your Agile Test Strategy The Three Pillars Approach to Your Agile Test Strategy
The Three Pillars Approach to Your Agile Test Strategy Brian Estep
 
Agile 2012 the 0-page agile test plan - paul carvalho
Agile 2012   the 0-page agile test plan - paul carvalhoAgile 2012   the 0-page agile test plan - paul carvalho
Agile 2012 the 0-page agile test plan - paul carvalhodrewz lin
 
How to brew a tasty agile test strategy
How to brew a tasty agile test strategyHow to brew a tasty agile test strategy
How to brew a tasty agile test strategyDr. Alexander Schwartz
 
Designing Agile Test Strategy for Mobile Apps By Parimala Hariprasad
Designing Agile Test Strategy for Mobile Apps By Parimala HariprasadDesigning Agile Test Strategy for Mobile Apps By Parimala Hariprasad
Designing Agile Test Strategy for Mobile Apps By Parimala HariprasadAgile Testing Alliance
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessLee Barnes
 
Jarian van de Laar - Test Policy - Test Strategy
Jarian van de Laar - Test Policy - Test Strategy Jarian van de Laar - Test Policy - Test Strategy
Jarian van de Laar - Test Policy - Test Strategy TEST Huddle
 
Agile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroidsAgile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroidsVipul Gupta
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussionajrhem
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application TestingRicha Goel
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)Usersnap
 

Destacado (20)

Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Experience Report in #DEWT5: Where is test strategy with an agile team
Experience Report in #DEWT5: Where is test strategy with an agile teamExperience Report in #DEWT5: Where is test strategy with an agile team
Experience Report in #DEWT5: Where is test strategy with an agile team
 
Methods to test an e-learning Web application.
Methods to test an e-learning Web application.Methods to test an e-learning Web application.
Methods to test an e-learning Web application.
 
Testing Web Application Security
Testing Web Application SecurityTesting Web Application Security
Testing Web Application Security
 
Database Web Application User Test 2
Database Web Application User Test 2Database Web Application User Test 2
Database Web Application User Test 2
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
 
Getting Ready for UAT
Getting Ready for UATGetting Ready for UAT
Getting Ready for UAT
 
The Three Pillars Approach to Your Agile Test Strategy
The Three Pillars Approach to Your Agile Test Strategy The Three Pillars Approach to Your Agile Test Strategy
The Three Pillars Approach to Your Agile Test Strategy
 
Agile 2012 the 0-page agile test plan - paul carvalho
Agile 2012   the 0-page agile test plan - paul carvalhoAgile 2012   the 0-page agile test plan - paul carvalho
Agile 2012 the 0-page agile test plan - paul carvalho
 
How to brew a tasty agile test strategy
How to brew a tasty agile test strategyHow to brew a tasty agile test strategy
How to brew a tasty agile test strategy
 
Test Strategy
Test StrategyTest Strategy
Test Strategy
 
Designing Agile Test Strategy for Mobile Apps By Parimala Hariprasad
Designing Agile Test Strategy for Mobile Apps By Parimala HariprasadDesigning Agile Test Strategy for Mobile Apps By Parimala Hariprasad
Designing Agile Test Strategy for Mobile Apps By Parimala Hariprasad
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for Success
 
Jarian van de Laar - Test Policy - Test Strategy
Jarian van de Laar - Test Policy - Test Strategy Jarian van de Laar - Test Policy - Test Strategy
Jarian van de Laar - Test Policy - Test Strategy
 
Agile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroidsAgile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroids
 
Testing web application
Testing web applicationTesting web application
Testing web application
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussion
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application Testing
 
Why a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test StrategyWhy a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test Strategy
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)
 

Similar a Lab 7b) test a web application

Lab 7a) debug a web application
Lab 7a) debug a web applicationLab 7a) debug a web application
Lab 7a) debug a web applicationtechbed
 
Lab 2) develop a java application
Lab 2) develop a java applicationLab 2) develop a java application
Lab 2) develop a java applicationtechbed
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts applicationtechbed
 
Lab 4) working with databases
Lab 4) working with databasesLab 4) working with databases
Lab 4) working with databasestechbed
 
Lab 5b) create a java server faces application
Lab 5b) create a java server faces applicationLab 5b) create a java server faces application
Lab 5b) create a java server faces applicationtechbed
 
Lab 6) package and deploy a j2 ee application
Lab 6) package and deploy a j2 ee applicationLab 6) package and deploy a j2 ee application
Lab 6) package and deploy a j2 ee applicationtechbed
 
Part 2 java development
Part 2 java developmentPart 2 java development
Part 2 java developmenttechbed
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applicationstechbed
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfAnanthReddy38
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with SeleniumDave Haeffner
 
Lab 3) create a web application
Lab 3) create a web applicationLab 3) create a web application
Lab 3) create a web applicationtechbed
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee applicationKumar
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter TestingArchanaKalapgar
 
Test it! Unit, mocking and in-container Meet Arquillian!
Test it! Unit, mocking and in-container Meet Arquillian!Test it! Unit, mocking and in-container Meet Arquillian!
Test it! Unit, mocking and in-container Meet Arquillian!Ivan Ivanov
 
Shahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md
 
Part 5 running java applications
Part 5 running java applicationsPart 5 running java applications
Part 5 running java applicationstechbed
 

Similar a Lab 7b) test a web application (20)

Lab 7a) debug a web application
Lab 7a) debug a web applicationLab 7a) debug a web application
Lab 7a) debug a web application
 
Lab 2) develop a java application
Lab 2) develop a java applicationLab 2) develop a java application
Lab 2) develop a java application
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts application
 
Lab 4) working with databases
Lab 4) working with databasesLab 4) working with databases
Lab 4) working with databases
 
Lab 5b) create a java server faces application
Lab 5b) create a java server faces applicationLab 5b) create a java server faces application
Lab 5b) create a java server faces application
 
Lab 6) package and deploy a j2 ee application
Lab 6) package and deploy a j2 ee applicationLab 6) package and deploy a j2 ee application
Lab 6) package and deploy a j2 ee application
 
Part 2 java development
Part 2 java developmentPart 2 java development
Part 2 java development
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applications
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdf
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
 
Lab 3) create a web application
Lab 3) create a web applicationLab 3) create a web application
Lab 3) create a web application
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee application
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter Testing
 
Selenium and JMeter
Selenium and JMeterSelenium and JMeter
Selenium and JMeter
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Test it! Unit, mocking and in-container Meet Arquillian!
Test it! Unit, mocking and in-container Meet Arquillian!Test it! Unit, mocking and in-container Meet Arquillian!
Test it! Unit, mocking and in-container Meet Arquillian!
 
Codeception
CodeceptionCodeception
Codeception
 
Shahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md Test Engineer
Shahnawaz Md Test Engineer
 
Part 5 running java applications
Part 5 running java applicationsPart 5 running java applications
Part 5 running java applications
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 

Más de techbed

1456.base boot
1456.base boot1456.base boot
1456.base boottechbed
 
1455.ata atapi standards - 1-7
1455.ata atapi standards - 1-71455.ata atapi standards - 1-7
1455.ata atapi standards - 1-7techbed
 
1454.ata features
1454.ata features1454.ata features
1454.ata featurestechbed
 
1432.encoding concepts
1432.encoding concepts1432.encoding concepts
1432.encoding conceptstechbed
 
Flash cs4 tutorials_2009
Flash cs4 tutorials_2009Flash cs4 tutorials_2009
Flash cs4 tutorials_2009techbed
 
Photoshop tut
Photoshop tutPhotoshop tut
Photoshop tuttechbed
 
What is struts_en
What is struts_enWhat is struts_en
What is struts_entechbed
 
Part 7 packaging and deployment
Part 7 packaging and deploymentPart 7 packaging and deployment
Part 7 packaging and deploymenttechbed
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-entechbed
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databasestechbed
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web developmenttechbed
 
Part 1 workbench basics
Part 1 workbench basicsPart 1 workbench basics
Part 1 workbench basicstechbed
 
Lab 1) rad installation
Lab 1) rad installationLab 1) rad installation
Lab 1) rad installationtechbed
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testingtechbed
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deploymenttechbed
 
5) running applications
5) running applications5) running applications
5) running applicationstechbed
 
4) databases
4) databases4) databases
4) databasestechbed
 
3) web development
3) web development3) web development
3) web developmenttechbed
 
2009 ibm academic initiative
2009 ibm academic initiative2009 ibm academic initiative
2009 ibm academic initiativetechbed
 
2) java development
2) java development2) java development
2) java developmenttechbed
 

Más de techbed (20)

1456.base boot
1456.base boot1456.base boot
1456.base boot
 
1455.ata atapi standards - 1-7
1455.ata atapi standards - 1-71455.ata atapi standards - 1-7
1455.ata atapi standards - 1-7
 
1454.ata features
1454.ata features1454.ata features
1454.ata features
 
1432.encoding concepts
1432.encoding concepts1432.encoding concepts
1432.encoding concepts
 
Flash cs4 tutorials_2009
Flash cs4 tutorials_2009Flash cs4 tutorials_2009
Flash cs4 tutorials_2009
 
Photoshop tut
Photoshop tutPhotoshop tut
Photoshop tut
 
What is struts_en
What is struts_enWhat is struts_en
What is struts_en
 
Part 7 packaging and deployment
Part 7 packaging and deploymentPart 7 packaging and deployment
Part 7 packaging and deployment
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-en
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databases
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web development
 
Part 1 workbench basics
Part 1 workbench basicsPart 1 workbench basics
Part 1 workbench basics
 
Lab 1) rad installation
Lab 1) rad installationLab 1) rad installation
Lab 1) rad installation
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testing
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deployment
 
5) running applications
5) running applications5) running applications
5) running applications
 
4) databases
4) databases4) databases
4) databases
 
3) web development
3) web development3) web development
3) web development
 
2009 ibm academic initiative
2009 ibm academic initiative2009 ibm academic initiative
2009 ibm academic initiative
 
2) java development
2) java development2) java development
2) java development
 

Último

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 

Último (20)

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

Lab 7b) test a web application

  • 1. V4.1 Instructor Exercises Guide EXempty Exercise 6. Test a Web Application What this exercise is about In this lab, you will create and execute component tests on a Web application. The first test case focuses on the Java classes within the application. The second test case treats the entire Web application as one component. You will record and play back HTTP messages to test the Web application’s behavior. What you should be able to do At the end of the lab, you should be able to: • Create a test project and test suite to hold test artifacts • Create a JUnitTest • Capture HTTP messages using HTTP Recording • Configure a URL Test Suite to test Web application components • Execute a URL Test Suite against a Web application Introduction The automated component test features available in the IBM Rational Developer (V7 and later) products help you find defects easily, improving the overall quality of Java and J2EE applications. The component test capabilities provide an end-to-end test solution by allowing you to create, edit, run, and view results for tests. Tests also facilitate the reuse of test suites. This feature allows tests to be used throughout the development process. This exercise highlights how to use the automated component testing features available with Rational Application Developer. Following the library case study, you will create two types of tests: a Java application test and a URL application test. In the Java test case, you will test the model classes in the LibraryUtility Java application. Examine the behavior of the item and patron objects as you perform routine operations. The second test examines the LibraryWeb Web application as a whole. Record and playback HTTP messages to determine whether the application is functioning properly. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-1 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 2. Instructor Exercises Guide Requirements Before starting this lab, you must complete the library database set up from Exercise 1. Develop a Java Application. You must also set up the LibraryWeb Web project according to the instructions in Exercise 3. This exercise requires several code fragments and files. Make sure that these files appear in the <LAB_FILES>Test directory before starting the lab. Warning This lab is very sensitive to firewall, proxy, and intrusion detection software. Instructor exercise overview This lab focuses on two types of test: Java and URL test. Developers should use Java component tests to exercise Java applications and Java classes within a project. As a Java application itself, Java tests do not need to run in an application server. As such, the library application itself must switch from using the JDBC data source to direct JDBC calls in the first test suite. Students modify the properties file to alter the behavior of the DriverManager class. The library application was designed to support a range of data access methods. The second type of test treats the entire Web application as one component. URL test cases replay recorded HTTP messages. Its support will appear more rudimentary than the other types of component tests. Students need to work through a series of steps to configure a URL application test. Unlike the Java application test, there is no view to determine whether a test case passed or failed, except for checking the HTTP status code. Make sure that students stop the integrated test environment before running the Java component test. The library database does not allow concurrent access; this is the behavior of the Cloudscape database as configured through the steps in the Lab Set Up guide. The test case will not be able to access the library database and it will fail. If derby.jar is not added to LibraryTest project’s build path, the students will get a NullPointer exception when they try to access the database - as a connection cannot be created. 6-2 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 3. V4.1 Instructor Exercises Guide EXempty Exercise instructions Preface The lab exercises in this course are designed to run in sequence. If you have skipped one of the previous labs, you must follow the steps in Appendix A before starting this lab. The following references in the exercise instructions represent directory locations in your workstation: • <LAB_FILES>: C:LabFiles70 • <SDP_DIR>: c:IBMSDP70 © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-3 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 4. Instructor Exercises Guide 6.1. Create a Test Project Before you can create a component test case, you need a Java project to hold the test cases and test run results. Enable the component test capability to reveal the Test wizard and perspective. Run the component test project wizard to create a new test project. __ 1. Switch to the Test perspective. __ a. Select Window Open Perspective Other Test from the main menu. (Note that you may have to select the Show all check box in the Open Perspective dialog.) __ b. Click OK to Confirm Enablement. __ 2. Create a Java project named LibraryTest to hold test cases and test run results. __ a. From the main menu, select File New Project. __ b. In the New Project wizard, select Java Project. Click Next. __ c. Type LibraryTest for the Project name. __ d. Click Finish. If prompted, do not switch to the Java perspective. __ 3. Create tests and assets folders in LibraryTest to organize the artifacts you will create in this exercise. __ a. Right-click LibraryTest and select New Folder. Type tests as the Folder name. __ b. Click Finish. __ c. Right-click LibraryTest and select New Folder. Type assets as the Folder name. __ d. Click Finish. __ 4. Add LibraryUtility to the Build Path of LibraryTest. This will allow the tests to access the classes in that project. __ a. Right-click LibraryTest and select Properties Java Build Path. __ b. In the Properties for LibraryTest dialog, select the Projects tab and click Add. __ c. In the Required Project Selection dialog, select LibraryUtility and click OK. 6-4 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 5. V4.1 Instructor Exercises Guide EXempty __ d. Click OK. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-5 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 6. Instructor Exercises Guide 6.2. Create a JUnit Test Create a JUnit test to exercise the Patron Java class. JUnit tests treat one or more Java classes as a unit of test. __ 5. Create a TPTP JUnit Test in the Test perspective. __ a. Switch to the Test perspective. You can either click Test in the perspective toolbar or select Window Open Perspective Other from the main menu and select Test. __ b. In the Test Navigator, right-click LibraryTest and select New Test Element TPTP JUnit Test. __ c. Click Next. Click Yes if you are prompted to add libraries to the build path. __ d. In the New JUnit Test Definition dialog, enter the following: - Package: com.ibm.library.testing - Name: PatronTest __ e. Click Next. __ f. On the next page, select LibraryTest/tests as the location of the new test. __ g. Click Finish. 6-6 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 7. V4.1 Instructor Exercises Guide EXempty __ 6. Add test methods findByEmail and getAllPatrons to the PatronTest. __ a. In the Test Editor, click the Test Methods tab. __ b. Click Add and type findByEmail for the Name. __ c. Click Add again and type getAllPatrons for the Name. Note With JUnit, the test methods name would usually have the prefix test. However you do not need to prefix the test method names in this tool. __ 7. Add behavior to the Patron Test, to invoke findByEmail and getAllPatrons. __ a. In the Test Editor, click the Behavior tab. __ b. Click Add Loop. Keep the iterations at 1. __ c. Click Add Invocation and double-click findByEmail. __ d. Select Loop1, as the following invocation will be a child of it. __ e. Click Add Invocation and double-click getAllPatrons. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-7 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 8. Instructor Exercises Guide __ f. Save all your changes. 6-8 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 9. V4.1 Instructor Exercises Guide EXempty 6.3. Edit the PatronTest Test Case The Test wizard created the PatronTest test case. You added two methods to this test case in the test editor: findByEmail and getAllPatrons. You will now implement the methods. __ 8. Open the behavior class(PatronTest) and add a patron field __ a. Press CTRL+SHIFT+R to open the Open Resource dialog. __ b. Type patron in the search field, and double-click PatronTest.java. __ c. Add the following field declaration on the line after the class declaration public class PatronTest extends HyadesTestCase { private Patron patron; __ d. Use Source Organize Imports to import the Patron class. __ 9. Replace the FindByEmail and getAllPatrons methods. You can cut and paste from <LABROOT>/Test/snippets/snippet-1.txt public void findByEmail() throws Exception { patron = Patron.findByEmail("jb@bogus.ibm.com"); assertEquals("Jim", p.getFirstName()); } public void getAllPatrons() throws Exception { Collection<Patron> patrons = null; © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-9 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 10. Instructor Exercises Guide patrons = Patron.getAllPatrons(); assertTrue(patrons.size() == 99); } __ 10. Use Source Organize Imports to import java.util.Collection. Save your changes. 6-10 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 11. V4.1 Instructor Exercises Guide EXempty 6.4. Use a JDBC Connection Instead of a Data Source The classes in LibraryUtility use the DriverManager class to establish connections to a database. However, data sources are not normally available to Java applications. In order to test the database functionalities in a plain Java™ Virtual Machine (JVM), the connection method must be temporarily changed to a JDBC connection. The Library application supports a variety of data access methods. Change the databaseInformation.properties file to switch the access method from a data source to direct JDBC calls. __ 11. Stop the server before continuing, in order to free the lock on the databaseinformation.properties file. __ a. In the Servers view, right-click WebSphere Application Server v6.1 and select Stop. __ 12. Make a backup copy of the existing properties file. __ a. Switch to the J2EE perspective. __ b. In the Project Explorer view, right-click LibraryUtility databaseInformation.properties file and select Refactor Rename. __ c. Change the name to databaseInformationBACKUP.properties. __ d. Click OK. __ 13. Copy the JDBC Connection properties to databaseInformation.properties. __ a. In the Project Explorer view, select databaseInformationJDBC.properties. __ b. Press CTRL+C and then press CTRL+V. __ c. In the Name Conflict dialog, change the name to databaseInformation.properties. __ d. Click OK. __ 14. Add the Derby database JAR, derby.jar, to the project build path of LibraryTest. __ a. Right-click the LibraryTest Java project in the Project Explorer view, and select Properties in the pop-up menu. __ b. In the Properties dialog, select Java Build Path in the left pane, and select the Libraries tab on the right pane. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-11 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 12. Instructor Exercises Guide __ c. Click Add External JARs, and browse to <SDP_DIR>runtimesbase_v61derbylibderby.jar. __ d. Click OK. 6-12 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 13. V4.1 Instructor Exercises Guide EXempty 6.5. Run the Component Tests At this point, you have a Java test case. The JavaUtility classes no longer depend on the JDBC data source provided by the server to connect to the library database. Run the test cases against the library application and examine the results from the test. Warning Firewalls, proxies, and intrusion detection software can interfere with the communication between Rational Application Developer and IBM® Rational® Agent Controller. Here are some possible issues: • Your computer configuration uses a proxy in your Web browser. Rational Application Developer may indicate compatibility issues. You may need to disable your proxy during this lab. • Your computer configuration uses intrusion detection software. The software may block Rational Application Developer from writing results to the local file system. You may see the following error when you run tests: No location specified. • You create a new IBM® WebSphere® Application Server profile using the Typical profile creation setting in the Profile Management Tool. The server is added as a Windows service. Rational Application Developer will try to start Agent Controller as a service as well. This will fail if you did not, as a separate task, install Agent Controller as a Windows service. __ 15. The LibraryUtility Java project needs direct access to the library database. If you have not already done so, stop the server in order to close the JDBC connection to the database. __ a. From the Servers view, select WebSphere Application Server v6.1. __ b. If the server is running, click the Stop the server button from the view toolbar. __ c. Wait until the server stops and verify that the server Status is Stopped. __ 16. Run the PatronTest. __ a. Switch to the Test perspective. You can either click Test in the perspective toolbar or select Window Open Perspective Other from the main menu and select Test. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-13 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 14. Instructor Exercises Guide __ b. In the Test Navigator, right-click LibraryTest tests PatronTest and select Run As Test from the main menu. Note You can also select Run As Run and configure some options for your launch configuration. __ 17. Examine the results of the test case execution. __ a. Double-click the LibraryTest PatronTest[Timestamp] test result. __ b. In the Test Log, look at the Verdict field. __ c. Click the Events tab and expand the events. 6-14 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 15. V4.1 Instructor Exercises Guide EXempty __ d. Click on the fail node for getAllPatrons, and notice that the assertion failed because of the wrong number of patrons. Note If both test executions fail, there may be a problem connecting to the database. Usually the error will be a NullPointerException. This is because the persistence layer is unable to create a connection to the database and returns null instead. Several problems could have occurred: • The LibraryUtility databaseInformation.properties file has invalid settings. • The file derby.jar was not added to the LibraryTest Build Path and a ClassNotFoundException was thrown that resulted in a null connection. • The server, the Data perspective, or some other process is connected to the database. If the preceding hints do not resolve the problem, add method breakpoints at the beginning of the findByEmail and getAllPatrons methods. In the Test Navigator, right-click LibraryTest tests PatronTest and select Debug As Test from the main menu. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-15 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 16. Instructor Exercises Guide 6.6. Restore the Data source Connection When you are done with the component test, you need to restore the connection for DriverManager back to using the data source. __ 18. Delete the existing database properties file. __ a. In the Project Explorer view, right-click the LibraryUtility databaseInformation.properties file and select Delete. __ b. Click Yes to the confirm delete dialog. __ 19. Rename the original database properties file back to its original file name. __ a. Right-click on the databaseInformationBACKUP.properties file and select Refactor Rename. __ b. In the Refactor Rename dialog, enter databaseInformation.properties as the new file name. __ c. Click OK to accept the new name. 6-16 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 17. V4.1 Instructor Exercises Guide EXempty 6.7. Record an URL Test Case The component testing framework in Rational Application Developer also supports Web application testing. In order to test a Web application, you must capture a HTTP request message and play it back under test conditions. In this section, record your interaction with the patron item search servlet through the search.jsp page. Warning If your computer configuration uses a proxy in your Web browser, Rational Application Developer may indicate compatibility issues. You may need to disable your proxy during this lab. However you may then need to switch to communicating to the server via SOAP. To do so, in the Servers view, double-click the test server, and click SOAP in the Server connection type and admin port area. If you computer configuration uses intrusion detection software, it may block Rational Application Developer from writing results to the local file system. You may see the following error when you run tests: No location specified. __ 20. Switch to the Test perspective. __ 21. Create a Recorder Artifact. __ a. In the Test Navigator view, right-click LibraryTest, and select New Test Element Recording HTTP Recording. __ b. In the HTTP Recording dialog, select the LibraryTest tests folder. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-17 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 18. Instructor Exercises Guide __ c. Change the Recording file name to LibraryHTTPRecording.rec. __ d. Click Finish. This will open an external Web browser. __ 22. Start the server. __ a. Open the Servers view by selecting Window Show View Other from the main menu, and then select Server Servers from the Show View dialog. __ b. In the Servers view, right-click WebSphere Application Server V6.1 and select Start. __ c. Wait until the server status is Started. __ 23. Browse the library project from the external Web browser that opened automatically when you created the recording. Your actions will be recorded by the tool. __ a. In the browser address bar, enter http://localhost:9080/Library/search.jsp. Click Enter. 6-18 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 19. V4.1 Instructor Exercises Guide EXempty __ b. Enter abc@ibm.com in the Search Phrase text box and select the Email radio button. Click Search. __ c. The no result page should display. Click Go Back to the Search Page. __ d. Back on the search page, enter 4 in the Search Phrase and select Patron ID as the Criteria. Click Search. __ e. The list items page should now show up indicating a successful search. __ f. Close the browser. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-19 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 20. Instructor Exercises Guide __ 24. Customize the HTTP Recording. __ a. LibraryHTTPRecording should automatically be loaded into the editor once the external browser closes. Switch to the Behavior tab of the editor. __ b. Select Loop 1 in the Behavior column. __ c. Enter 10 in the Number of Iterations field. __ d. Save the changes. 6-20 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 21. V4.1 Instructor Exercises Guide EXempty 6.8. Generate Executable URL Test The LibraryHTTPRecording Test Suite stores the HTTP messages captured by the recorder. To playback the captured HTTP messages, generate executable URL tests from the URL test suite. __ 25. Generate a Java class that executes the URL test. __ a. In the Test Navigator view, expand LibraryTest tests. __ b. Right-click LibraryHTTPRecording and select Generate. __ c. In the TPTP URL (JUnit) Test Definition Code Generation dialog, set /LibraryTest as the Source Folder. Click Finish. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-21 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 22. Instructor Exercises Guide 6.9. Create a Deployment File for the Test Suite The deployment file test artifact specifies which test suite and test cases belong to the HTTP test. Use the test artifact wizard to create a deployment file and associate the HTTP test suite to the file. __ 26. Create a Deployment file for LibraryHTTPRecording. __ a. In the Test Navigator view, right-click LibraryTest New Test Element. Select Test Assets Deployment. Click Next. __ b. In the New Deployment dialog, select LibraryTest Test Suite assets as the parent folder, and enter LibraryHTTPDeploy as the Name. __ c. Click Next. __ d. On the description page, click Next. __ e. In the define artifacts page, click Add. 6-22 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 23. V4.1 Instructor Exercises Guide EXempty __ f. In the Add Artifact Association dialog, select Create a new resource, click Next. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-23 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 24. Instructor Exercises Guide __ g. Select LibraryTest assets as the parent folder and enter LibraryHTTPArtifact as the Name. Click Next. __ h. In the description page, click Next. 6-24 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 25. V4.1 Instructor Exercises Guide EXempty __ i. In the define test assets page, select LibraryHTTPRecording.testsuite. Click Finish. __ j. Back to the New Deployment dialog, LibraryHTTPArtifact should now be shown in the list. __ k. Click Next. __ 27. Create a new location test artifact to hold test case data associated with the HTTP test suite. __ a. In the define locations page, click Add to bring up the Add Location Association dialog. __ b. In the Add Location Association dialog, select Create new resource, then click Next. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-25 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 26. Instructor Exercises Guide __ c. In the define file resource page, select LibraryTest assets as the parent folder and enter LibraryHTTPLocation as the Name. __ d. Click Finish. 6-26 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 27. V4.1 Instructor Exercises Guide EXempty __ e. Back in the location page of the New Deployment dialog, LibraryHTTPLocation should now be shown in the list. __ f. Click Next. __ g. In the define mapping page, select LibraryHTTPArtifact on the left and LibraryHTTPLocation on the right, then click the down arrow to add the mapping to the list below. © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-27 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 28. Instructor Exercises Guide __ h. Click Finish. 6-28 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 29. V4.1 Instructor Exercises Guide EXempty 6.10. Run the URL Test With all of the HTTP test suite artifacts created, you can now run the URL test suite. Create a launch configuration to specify which URL test case to run. Execute the URL test and examine the results, written to in the LibraryTest project. __ 28. Run the URL test. __ a. Right-click LibraryTest tests LibraryHTTPRecording and select Run As Test. Note You can also select Run As Run and configure some options for your launch configuration. __ 29. Once the URL test finishes, examine the test results. __ a. Double-click LibraryTest LibraryHTTPRecording. __ b. Expand Loop, Page, and invocation to examine individual results. End of exercise © Copyright IBM Corp. 2004, 2007 Exercise 6. Test a Web Application 6-29 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.