簡易檢索 / 詳目顯示

研究生: 范凱翔
Fan, Kai-Hsiang
論文名稱: 將 Command-Target-Value 型態式腳本轉換為 Playwright 程式碼之研究
Playwright Code Generation for Recorded Scripts of Command-Target-Value
指導教授: 李信杰
Lee, Shin-Jie
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Department of Computer Science and Information Engineering
論文出版年: 2024
畢業學年度: 112
語文別: 英文
論文頁數: 91
中文關鍵詞: 網頁自動化測試PlaywrightRapi RecorderRecord-Playback
外文關鍵詞: Automated Testing, Playwright, Rapi Recorder, Record-Playback
相關次數: 點閱:33下載:2
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著網頁應用程式的迅速發展,網頁測試變得愈加重要,自動化測試工具在提升測試效率和準確性方面扮演了關鍵角色。然而,現有的 Record-Playback 工具,如 Selenium IDE 和 Katalon Recorder,雖然對於非技術測試人員友好,但在應對複雜測試情境時仍然存在局限。因此,本研究開發了一個擴展功能,使 Rapi Recorder 能夠將記錄的測試動作導出為 Playwright 測試程式碼,以填補當前 Record-Playback 工具在現代測試框架支持方面的空白。研究內容包括系統架構的設計和實現、在 Rapi 中實現了 99 個可用指令中的 97 個指令、跨瀏覽器測試結果的評估,以及 7 個測試案例的展示。測試結果顯示,這項功能提高了測試腳本生成的靈活性和可擴展性。

    With the rapid development of web applications, web testing has become increasingly important, and automated testing tools play a crucial role in improving testing accuracy. However, existing record-playback tools, such as Selenium IDE and Katalon Recorder, while user-friendly for non-technical testers, face limitations in handling complex testing scenarios. Therefore, this research developed an extended feature to enable Rapi Recorder to export recorded testing actions as Playwright test code, addressing the gap in current record-playback tools for supporting modern testing frameworks. The study includes the design and implementation of the system architecture, the implementation of 97 out of the 99 available commands in Rapi, the evaluation of cross-browser testing results, and the demonstration of 7 test cases. The test results indicate that this feature enhances the flexibility and scalability of test script generation.

    中文摘要 i Abstract ii Acknowledgements iii Contents iv List of Tables vii List of Figures viii Chapter 1 Introduction 1 Chapter 2 Background 3 2.1 Overview of Automation Testing Tools 3 2.1.1 API-Based Testing Tools 3 2.1.2 Record-Playback Testing Tools 4 2.2 Playwright API Introduction 4 2.2.1 Detailed API Functionalities 4 2.3 Introduction to Rapi Recorder 7 2.3.1 Background and Features 7 2.3.2 Command Execution in Rapi 8 2.3.3 Important Commands in This Research 8 Chapter 3 System Design 13 3.1 Use Case Diagram 13 3.2 Export Process to Playwright Code 14 3.3 Class Diagrams and Introductions 17 3.3.1 CodeGenerator 17 3.3.2 CommandExecuteHandler 21 3.3.3 ICommand Interfaces 22 3.3.4 PlaywrightTypeScriptCommandGenerator 23 3.3.5 Command Parsers 23 Chapter 4 Implementation Method 25 4.1 Locator Determination 25 4.2 Variable Management with Map 25 4.2.1 Commands with Locator 26 4.2.2 Commands without Locator 27 Chapter 5 Implementation 29 5.1 Mouse Event Commands 29 5.1.1 mouseMoveAt 30 5.1.2 Pseudocode for Helper Functions 31 5.1.3 dragAndDrop 33 5.1.4 Other Mouse Event Commands 34 5.2 Keyboard Input Commands 34 5.2.1 sendKeys 35 5.2.2 select, addSelection, removeSelection 35 5.2.3 Other Keyboard Input Commands 38 5.3 Dialog Interaction Commands 38 5.3.1 Only Executing Dialog Assertion 39 5.3.2 Only Executing Dialog Handling 39 5.3.3 Executing Both Commands 39 5.4 Assert and Verify Commands 40 5.5 Store Commands 43 5.6 Wait-For Commands 46 5.7 Control Flow Commands 46 5.8 Other Commands 47 5.8.1 selectFrame 47 5.8.2 selectWindow 49 5.8.3 echo 49 5.8.4 Other Commands Generated Example Code 52 Chapter 6 Experiment 55 6.1 Cross-Browser Testing Results 55 6.1.1 Chromium 55 6.1.2 Firefox 56 6.1.3 WebKit 56 6.1.4 Summary 57 6.2 Case Study 58 6.2.1 Mouse Event Type 58 6.2.2 Keyboard Input Commands 59 6.2.3 Dialog Interaction Commands 62 6.2.4 Store Commands 64 6.2.5 Wait-For Commands 66 6.2.6 Control Flow Commands 70 6.2.7 selectFrame and selectWindow 72 6.2.8 Summary 75 Chapter 7 Conclusion and Future Work 76 7.1 Conclusion 76 7.2 Future Work 76 References 77

    [1] Serdar Doğan and Aysu Betin-Can and Vahid Garousi. Web application testing: A systematic literature review. Journal of Systems and Software, 91:174–201, 2014.
    [2] Yuan-Fang Li, Paramjit K Das, and David L Dowe. Two decades of web application testing—a survey of recent advances. Information Systems, 43:20–54, 2014.
    [3] Vahid Garousi, Ali Mesbah, Aysu Betin-Can, and Shabnam Mirshokraie. A systematic mapping study of web application testing. Information and Software Technology, 55(8):1374–1396, 2013.
    [4] Anuja Arora. Web application testing: A review on techniques, tools and state of art. 2012.
    [5] Omar Javed, J. H. Dawes, Marta Han, G. Franzoni, A. Pfeiffer, Giles Reger, and Walter Binder. Perfci: A toolchain for automated performance testing during continuous integration of python projects. 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 1344–1348, 2020.
    [6] Maurizio Leotta, Diego Clerissi, Filippo Ricca, and Cristiano Spadaro. Comparing the maintainability of selenium webdriver test suites employing different locators: a case study. In Proceedings of the 2013 International Workshop on Joining AcadeMiA and Industry Contributions to Testing Automation, JAMAICA 2013, page 53–58, New York, NY, USA, 2013. Association for Computing Machinery.
    [7] Selenium — selenium.dev. https://www.selenium.dev/. [Accessed 06-06-2024].
    [8] A. Holmes and M. Kellogg. Automating functional tests using selenium. In AGILE 2006 (AGILE’06), pages 6 pp.–275, 2006.
    [9] Elior Vila, Galia Novakova, and Diana Todorova. Automation testing framework for web applications with selenium webdriver: Opportunities and threats. In Proceedings of the International Conference on Advances in Image Processing, ICAIP ’17, page 144–150, New York, NY, USA, 2017. Association for Computing Machinery.
    [10] T. Onufrieva, N. A. Borsuk, and E. S. Anokhina. Development of an application for automated testing of web forms. Programmnaya Ingeneria, 2023.
    [11] Maurizio Leotta, Diego Clerissi, Filippo Ricca, and Paolo Tonella. Capture-replay vs. programmable web testing: An empirical assessment during test case evolution. In 2013 20th Working Conference on Reverse Engineering (WCRE), pages 272–281, 2013.
    [12] Selenium IDE · Open source record and playback test automation for the web — selenium.dev. https://www.selenium.dev/selenium-ide/. [Accessed 05-06-2024].
    [13] Milad Hanna, Amal Elsayed Aboutabl, and Mostafa-Sami M Mostafa. Automated software testing framework for web applications. International Journal of Applied Engineering Research, 13(11):9758–9767, 2018.
    [14] Anuja Jain, S Prabu, and Swarnalatha Muhammad Rukunuddin Ghalib. Web-based automation testing framework. International Journal of Computer Applications, 975:8887, 2012.
    [15] Katalon Recorder — Web, Mobile & Browser Test Recorder — katalon.com. https://katalon.com/katalon-recorder-ide. [Accessed 05-06-2024].
    [16] Elis Pelivani and B. Çiço. A comparative study of automation testing tools for web applications. 2021 10th Mediterranean Conference on Embedded Computing (MECO), pages 1–6, 2021.
    [17] Inderjeet Singh and Bindia Tarika. Comparative analysis of open source automated software testing tools: Selenium, sikuli and watir. International Journal of Information & Computation Technology, 4(15):1507–1518, 2014.
    [18] Gerard Meszaros. Agile regression testing using record & playback. In Companion of the 18th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 353–360, 2003.
    [19] Monika Sharma and Rigzin Angmo. Web based automation testing and tools. International Journal of Computer Science and Information Technologies, 5(1):908–912, 2014.
    [20] Rigzin Angmo and Monika Sharma. Performance evaluation of web based automation testing tools. In 2014 5th International Conference-Confluence The Next Generation Information Technology Summit (Confluence), pages 731–735. IEEE, 2014.
    [21] Anand Singh Gadwal and Lalji Prasad. Impact of selenium in automation testing? challenges and opportunities. NeuroQuantology, 20(22):2789, 2022.
    [22] Mouna Hammoudi, Gregg Rothermel, and Paolo Tonella. Why do record/replay tests of web applications break? In 2016 IEEE International Conference on Software Testing, Verification and Validation (ICST), pages 180–190. IEEE, 2016.
    [23] Fast and reliable end-to-end testing for modern web apps — Playwright.
    [24] Dmitry Zhyhulin, Kostiantyn Kasian, and Mykola Kasian. Combined method of prioritization and automation of software regression testing. In 2022 IEEE 16th International Conference on Advanced Trends in Radioelectronics, Telecommunications and Computer Engineering (TCSET), pages 751–755. IEEE, 2022.
    [25] Kush Hiren Brahmbhatt. Comparative analysis of selecting a test automation framework for an e-commerce website.
    [26] Justus Bogner and Manuel Merkel. To type or not to type? a systematic comparison of the software quality of javascript and typescript applications on github. In Proceedings of the 19th International Conference on Mining Software Repositories, pages 658–669, 2022.
    [27] Mohammad Nurul Islam, Syed Mohammad, and Khurshaid Quadri. Framework for Automation of Cloud-Application Testing using Selenium ( FACTS ). Advances in Science, Technology and Engineering Systems Journal, 5(1):226–232, 2020.
    [28] Dario Olianas, Maurizio Leotta, Filippo Ricca, Matteo Biagiola, and Paolo Tonella. Stile: a tool for parallel execution of e2e web test scripts. In 2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST), pages 460–465, 2021.
    [29] Guangxuan Chen, Guangxiao Chen, Di Wu, Qiang Liu, Lei Zhang, and Xiaoshi Fan. A selenium-based web application automation test framework. In 2021 IEEE 2nd International Conference on Information Technology, Big Data and Artificial Intelligence (ICIBA), volume 2, pages 257–261, 2021.
    [30] S. Berner, R. Weber, and R.K. Keller. Observations and lessons learned from automated testing. In Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005., pages 571–579, 2005.
    [31] Shin-Jie Lee, Yu-Xian Chen, Shang-Pin Ma, and Wen-Tin Lee. Test command auto-wait mechanisms for record and playback-style web application testing. In 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC), volume 02, pages 75–80, 2018.
    [32] Rapi Recorder (Selenium IDE Alternative) — rapi.dev. https://www.rapi.dev/. [Accessed 06-06-2024].
    [33] Shin-Jie Lee, Jie-Lin You, and Sun-Yuan Hsieh. Automatically locating unnamed windows and inner frames for web regression testing. In 2017 International Conference on Applied System Innovation (ICASI), pages 184–187, 2017.
    [34] W3Schools Online Web Tutorials — w3schools.com. https://www.w3schools.com/. [Accessed 06-06-2024].

    下載圖示 校內:立即公開
    校外:立即公開
    QR CODE