| 研究生: |
曾德順 Zeng, De-Shun |
|---|---|
| 論文名稱: |
將 Command-Target-Value 型態式腳本轉換為 Selenium 程式碼之研究 Selenium Code Generation for Recorded Scripts of Command-Target-Value Style |
| 指導教授: |
李信杰
Lee, Shin-Jie |
| 學位類別: |
碩士 Master |
| 系所名稱: |
電機資訊學院 - 資訊工程學系 Department of Computer Science and Information Engineering |
| 論文出版年: | 2024 |
| 畢業學年度: | 112 |
| 語文別: | 英文 |
| 論文頁數: | 75 |
| 中文關鍵詞: | 網頁自動化測試 、錄製回放工具 、Command-Target-Value 、程式碼生成 、Selenium |
| 外文關鍵詞: | Web Automated Testing, Record-and-Playback Tool, Command-Target-Value, Code Generation, Selenium |
| 相關次數: | 點閱:57 下載:5 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
本研究旨在將Rapi Recorder記錄的Command-Target-Value型態腳本轉換為Java語言的Selenium程式碼,以提升錄製與回放工具的靈活性和可擴展性。這些工具在自動化測試中具有重要作用,使測試人員能夠迅速錄製並回放測試腳本。然而,由於不同網頁實現中的JavaScript行為差異,這些腳本的回放常面臨挑戰。為了解決這些挑戰,我們設計並實現了一個程式碼生成器(Code Generator),能將Rapi Recorder的99種命令轉換為Selenium程式碼。在實作過程中,我們遇到了諸如元素定位的穩定性、精確還原鼠標移動、動作延遲過長以及選擇最佳測試腳本等問題。本文詳述了解決這些問題的方法,並介紹了程式碼生成器的設計和架構,闡述其中實作的指令解析、狀態管理、後處理和整合的步驟,並通過案例研究展示具體的指令轉換過程。實驗結果表明,我們的方法在提升測試腳本靈活性和效率的同時,保證了其準確性,這為自動化測試提供了一個有效的解決方案。此外,經由跨瀏覽器測試驗證了生成程式碼的兼容性,進一步強化了我們方法的實用性和可靠性。
This study focuses on converting command-target-value scripts from Rapi Recorder into Selenium code written in Java to enhance the flexibility and scalability of recording and playback tools, which are crucial for automated testing. The varying JavaScript behaviors across different web implementations pose challenges in script replay. To address these challenges, we developed a Code Generator capable of transforming 99 types of commands from Rapi Recorder into Selenium code. We tackled key issues such as element localization stability, precise mouse movement restoration, action delays, and optimal script selection. This paper details the solutions, the design and architecture of the Code Generator, and the processes of command parsing, state management, post-processing, and integration. Case studies are presented to illustrate specific command conversions. Experimental results demonstrate significant improvements in script flexibility and efficiency while maintaining accuracy. Furthermore, cross-browser testing confirmed the compatibility of the generated code, reinforcing the practicality and reliability of our method.
[1] S. Ivanova and G. Georgiev, "Using Modern Web Frameworks When Developing an Education Application: A Practical Approach," 2019 42nd International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), pp. 1485-1491, 2019.
[2] Y. Li, P. K. Das and D. L. Dowe, "Two decades of Web application testing—A survey of recent advances," Information Systems, vol. 43, pp. 20-54, 2014.
[3] S. Murugesan, "Web application development: Challenges and the role of web engineering," in Web engineering: Modelling and implementing web applications, London, Springer London, 2008, pp. 7-32.
[4] D. Kumar and K. K. Mishra, "The Impacts of Test Automation on Software's Cost, Quality and Time to Market," Procedia Computer Science, vol. 79, pp. 8-15, 2016.
[5] S. Ahamed, "Studying the Feasibility and Importance of Software Testing: An Analysis," International Journal of Environmental Science and Technology, vol. 1, no. 3, pp. 119-128, 2009.
[6] M. Polo, P. Reales, M. Piattini and C. Ebert, "Test Automation," IEEE Software, vol. 30, no. 1, pp. 84-89, 2013.
[7] A. Arora and M. Sinha, "Web application testing: A review on techniques, tools and state of art," International Journal of Scientific & Engineering Research, vol. 3, no. 2, p. 1, 2012.
[8] F. Ricca and P. Tonella, "Analysis and testing of web applications," in Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001, 2001.
[9] N. Alshahwan and M. Harman, "Automated web application testing using search based software engineering," in 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), 2011.
[10] B. Popp, F. Sweiss, D. Barsan, G. Stasa and S. Niyogi, "Automated system for tresting a web application". US Patent 10/972,162, 11 5 2006.
[11] S. Gojare, R. Joshi and D. Gaigaware, "Analysis and design of selenium webdriver automation testing framework," Procedia Computer Science, vol. 50, pp. 341-346, 2015.
[12] M. A. Benedikt, J. F. Silva, P. I. Godefroid and A. Vyas, "Automatic exploration and testing of dynamic Web sites". US Patent 7716322, 11 5 2010.
[13] M. Leotta, D. Clerissi, F. Ricca and P. Tonella, "Capture-Replay vs. Programmable Web Testing: An Empirical Assessment during Test Case Evolution," 2013 20th Working Conference on Reverse Engineering (WCRE), pp. 272-281, 2013.
[14] A. M. Memon and B. N. Nguyen, "Advances in Automated Model-Based System Testing of Software Applications with a GUI Front-End," Advances in Computers, vol. 80, pp. 121-162, 2010.
[15] M. Sharma and R. Angmo, "Web based automation testing and tools," International Journal of Computer Science and Information Technologies, vol. 5, no. 1, pp. 908-912, 2014.
[16] R. Angmo and M. Sharma, "Performance evaluation of web based automation testing tools," in 2014 5th International Conference-Confluence The Next Generation Information Technology Summit (Confluence), 2014.
[17] M. Hanna, A. E. Aboutabl and M.-S. M. Mostafa, "Automated software testing framework for web applications," International Journal of Applied Engineering Research, vol. 13, no. 11, pp. 9758-9767, 2018.
[18] A. Jain, S. Prabu and S. M. R. Ghalib, "Web-Based Automation Testing Framework," International Journal of Computer Applications, vol. 975, p. 8887, 2012.
[19] E. Vila, G. Novakova and D. Todorova, "Automation testing framework for web applications with Selenium WebDriver: Opportunities and threats," in Proceedings of the International Conference on Advances in Image Processing, 2017.
[20] P. Kunte and D. Mane, "Automation Testing of Web based application with Selenium and HP UFT (QTP)," International Research Journal of Engineering and Technology (IRJET), vol. 406, no. 2395-0072, pp. 2579-2583, 2017.
[21] S. Kapoor and K. Sagar, "AutoJet: Web Application Automation Tool," in Towards Extensible and Adaptable Methods in Computing, Springer, 2018, pp. 27-42.
[22] K. Sen, S. Kalasapur, T. Brutch and S. Gibbs, "Jalangi: a selective record-replay and dynamic analysis framework for JavaScript," in Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, 2013.
[23] S. R. Choudhary, H. Versee and A. Orso, "A cross-browser web application testing tool," in 2010 IEEE international conference on software maintenance, 2010.
[24] S. Berner, R. Weber and R. K. Keller, "Observations and lessons learned from automated testing," in Proceedings of the 27th international conference on Software engineering, 2005, pp. 571-579.
[25] M. A. Jamil, M. Arif, N. S. A. Abubakar and A. Ahmad, "Software testing techniques: A literature review," 2016 6th International Conference on Information and Communication Technology for The Muslim World (ICT4M), pp. 177-182, 2016.
[26] K. Sneha and G. M. Malle, "Research on software testing techniques and software automation testing tools," 2017 International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS), pp. 77-81, 2017.
[27] S. Gojare, R. Joshi and D. Gaigaware, "Analysis and Design of Selenium WebDriver Automation Testing Framework," Procedia Computer Science, vol. 50, pp. 341-346, 2015.
[28] E. Vila, G. Novakova and D. Todorova, "Automation Testing Framework for Web Applications with Selenium WebDriver: Opportunities and Threats," Proceedings of the International Conference on Advances in Image Processing, pp. 144-150, 2017.
[29] "Katalon Recorder," Katalon LLC, [Online]. Available: https://www.katalon.com/katalon-recorder-ide/.
[30] M. Hammoudi, G. Rothermel and P. Tonella, "Why do record/replay tests of web applications break?," in 2016 IEEE International Conference on Software Testing, Verification and Validation (ICST), IEEE, 2016, pp. 180-190.
[31] F. Ricca, M. Leotta, A. Stocco, D. Clerissi and P. Tonella, "Web testware evolution," in 2013 15th IEEE International Symposium on Web Systems Evolution (WSE), 2013.
[32] "Selenium IDE," Software Freedom Conservancy, [Online]. Available: https://www.selenium.dev/selenium-ide/.
[33] "Rapi Recorder," [Online]. Available: https://www.rapi.dev/.
[34] S.-J. Lee, Y.-X. Chen, S.-P. Ma and W.-T. 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), 2018.
[35] M. Leotta, B. García, F. Ricca and J. Whitehead, "Challenges of End-to-End Testing with Selenium WebDriver and How to Face Them: A Survey," in 2023 IEEE Conference on Software Testing, Verification and Validation (ICST), Dublin, Ireland.