Effective GUI Test Automation Developing an Automated GUI Testing Tool phần 8

AutomatedGUITest lớp. Bạn có thể tham khảo danh sách đầy đủ bằng cách tải về mã nguồn mẫu từ các trang web này của cuốn sách . Phần tiếp theo sẽ hướng dẫn bạn thông qua vào hàng loạt cuối cùng của mã vào các lớp học GUITestScript. | Enhancing the AutomatedGUITest Tool 305 AutomatedGUITest class. You can refer to the full listing by downloading the sample source code from this book s web pages at . The next section will guide you through entering the last batch of code into the GUITestScript class. Updating the GUITestScript Class Since verifications happen after the execution of the test the modification of the AutomateGUITest class and the GUITestDataCollector class prepares basic information for verification. The final verification occurs within the GUITestScript class. In this section you will add code to obtain a fully functional test script and complete the project with many of the advanced testing functions. The modifications in this chapter often involve the addition of some new fields. The GUITestScript class also needs new fields as shown here private TypeVerification testResult private int MaxLen 10000 The first field is in the place of the private ArrayList resultList as coded in Chapter 7. Thus after the addition of the new field you can remove the declaration of the resultList object. The second field initializes an integer variable as the definition of the maximum length of a string this test script can extract from a GUI control. The value 10 000 is an arbitrary number that represents the maximum length of a text string the tool can hold. Next you need to modify the four Timer tick events. The tmrAutomatedTest_Tick event code after the modification should be similar to the code in Listing the newly added lines are in bold and an obsolete line is commented and in bold . Listing The Modified Code for the tmrAutomatedTest_Tick Event private void tmrAutomatedTest_Tick object sender e StartAUT false true resultList new ArrayList testResult new TypeVerification 306 Chapter 8 Methods of GUI Test Verification The new lines

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.