In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Following the last http://tianxietaotao.blog.51cto.com/12002420/1951701 article, I'll give you a brief introduction to my tool.
First, the picture above:
Production background:
Web automated testing has become more and more common in the testing field, but writing code is weak for many testing ape code, and it is troublesome to build a system. So I made this simple tool in my spare time: here's a brief introduction to the function.
A brief introduction to the tool:
1. Toolbar: Resume: debug phase execution to the next breakpoint next: step-by-step debug/run mode switch execution, stop
2. Use case tree: use cases are maintained by execl or xml and can be added to the test system
3. Workspace: easy to execute and debug when a single use case is executed, including table to view use case data and find breakpoints to find elements to determine whether the writing is correct.
4. Log: execution log
5. Scheduling area: temporarily supports sequential execution, use case adjustment sequence deletion, etc.
I call this software the personal client version of Auto, although there are still many details to improve, I still introduce my process of writing this software, if there is any reference, you are welcome to complain.
Good habit. Picture above.
This picture is the core that the whole software can fully cover the function of selinum. Let's keep our eyes open here.
1. Initial idea
Selinum, we only focus on two points 1, element 2, and action.
When I am working on the software, it is also divided into two examples: 1, find element 2, and execute the action. With this idea, we can take the first step.
2. Refinement of ideas
1. Model design: the content contained in each command of the use case is abstracted as a java model.
2. Select use case sources such as execl, xml, etc. Here we introduce the use of execl.
This is enough for you to take the first step.
1. If you have used selinum, you should know that every findelement method of selinum returns WebElement WebElement and you can continue to find elements.
We can't cut this function. Chain search is very common. We looked at WebElement's class implementation tree and were pleasantly surprised to find that WebDriver and WebElement implemented the same interface. Polymorphism is used.
The find element method is designed as an entry
1. WebElement findElement (WebDriver dr, Command c) {return findElement (SearchContext, str);} 2, WebElement findElement (SearchContext dr, String [] str) {while (str.length) {findElement (dr, str [0])}; return dr;} 3, WebElement findElement (SearchContext dr, String str) {if (strb.startsWith ("xpath:")) {return dr.findElement (By.xpath (str.substring (6);}}
In this way, the class read according to the model is designed for 1 drop, 2 fall, 2 drop, 3, 3, and the problem of element search is solved.
2. Command: the simplest and stupidest way to design a command is to design the if else if time after the command. That's what I did.
In this way, there is the core of the foundation! The lack of encapsulation in the interface is also quite time-consuming. The above is for everyone to encourage!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.