tailieunhanh - Effective GUI Test Automation Developing an Automated GUI Testing Tool phần 10
Trong phần này, bạn sẽ thêm mã để có được một kịch bản thử nghiệm đầy đủ chức năng và hoàn thành dự án với rất nhiều các chức năng thử nghiệm tiên tiến. Các thay đổi trong chương này thường liên quan đến việc bổ sung một số lĩnh vực mới. Lớp GUITestScript cũng cần các lĩnh vực mới, như ở đây: | Needed Components for Testing User-Defined Controls 397 this event find the try-catch clause. You need to comment out the line in the curly brackets of the catch statement and add two lines of code like this formUT applicationUT startupForm The first line calls the StartControlUT method coded in the preceding section and assigns the test bench to the formUT object as the application under test. The formUT object has a Show method that makes the application under test visible and surveyable on the screen. Listing shows the new code and the commented-out code in bold for the btnStartGUITest_Click event. Listing New and Commented Code in Bold for the btnStartGUITest_Click Event private void btnStartGUITest_Click object sender e TypesToVerify new TypeVerificationSerializable GUISequence 0 added for chapter 8 GUITestSeqList new Specify an Application Under Test GUI Applications .EXE .DII .lXl .DII All files . . if applicationUT applicationUT GetTypeToTestFromAUT try formUT Form applicationUT startupForm catch InvalidCastException ex Chapter 13 formUT applicationUT startupForm else return 398 Chapter 13 User-Defined and COM-Based Controls As discussed the try-catch clause in the btnStartGUITest_Click event starts the application to test. When the object under test is a custom GUI control the execution of the statement in the try curly brackets throws an error. The error will be caught and the statements in the catch curly brackets will work smoothly to start the custom GUI control on the screen. Thus the updating of the file is completed. You can compile the project and correct errors. The coding task in the next section for modifying the .
đang nạp các trang xem trước