In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to learn selenium", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to learn selenium" this article.
To figure out what Selenium is?
Selenium is a browser automation tool, which is mainly used to automate Web testing and Web-based task management automation. It supports languages such as python, Java, ruby, JavaScript, etc., and can almost run on mainstream browsers.
Selenium2.0 and Selenium3.0 are mainly composed of three parts: SeleniumIDE, Selenium WebDriver and Selenoium Grid.
Selenium IDE: recording and playback scripts that simulate the actual actions of users on the page, unlike other tools: by intercepting http requests.
Generally speaking, the recording script is only regarded as an auxiliary function, because the slight change of a UI node may cause the automated testing tool to be unrecognizable. When the test project is large, it is very difficult to locate and update.
Second, recorded scripts are sometimes difficult for humans to understand.
Selenium Grid: implements the parallel execution of test cases on multiple machines and in heterogeneous environments. Parallel execution not only saves time, but also runs automated test scripts on different browsers and platforms at the same time.
Selenium WebDriver: developed for various browsers, directly controlling browsers through native browser support or extensions (Chrome webDrive, FireFox WebDriver)
VS Selenium RC (Selenium1.0): run javaScript in a browser and use the browser's built-in JavaScript to translate and execute selense
There are 5 steps to learn selenium:
Step 1: kindergarten stage
1. Choose a language: before learning automation, you have to choose a language to learn. At present, the most popular ones are java and python. I don't have any language foundation. I chose python as the scripting language for the introduction to automation.
2.python: if you choose a good language, you must learn the basic grammar. At present, there are two python scripts on the market: python2 and python3. Python2 is recommended for beginners.
3.python fundamentals: after choosing the python version, the next step is to learn the basics of python. The basics of python mainly include: print, variables, data types, for, if, while, these basic understanding, almost ready to start.
4.selenium:selenium currently has three versions: selenium1 is selenium RC, needless to say, we all know that selenium2 is the most popular at present; the new selenium3 is not much different from selenium2, mainly because you will encounter two pits when you start firefox, which is not suitable for rookies who have just started, so I recommend selenium2 for beginners.
Step 2: primary school stage
5.selenium API: many people like to use recording tools first when learning automation, but if they encounter the id of dynamic elements, playback will fail. So recording is not reliable, just understand the principle, it doesn't take much time. To learn selenium, let's just look at the api documents directly.
6. Element positioning: selenium provides eight element positioning: id, name, class, tag, link, patail_link, xpath, css. If Xiaobai doesn't understand, you can use firepath and firebug to help locate. First, through simple element attribute positioning, then you have to learn xpath.
7.xpath:xpath positioning can basically solve 80% of the element positioning problems. Xpath can be very useful, but it is bulky, slow in positioning elements, long in syntax and unstable, so it is necessary to learn css.
Step 3: middle school stage
8. Css:css positioning speed is fast, stable and ruthless, lightweight, concise grammar. But there are still some fuzzy matches, you still need to use xpath.
9. Action element: after positioning the element, it is followed by the operation element, the main difficulty is the mouse event and keyboard event.
10. Judgment element: after the operation, it is to get the return result, or to determine whether the element is the expected result.
11.unittest: the test framework helps us run use cases.
twelve。 Test report: html test report after the use case has been executed.
13. Send email: after the report is generated, email needs to be sent automatically
Step 3: high school
14. Function: when writing a use case, to solve the problem of repeated operation, it is necessary to write the commonly used method as a function call.
15. Classes and methods: many functions are written, and common operations can be written together. If you call them directly as needed, you need to learn classes and methods. 16. Parameterization: if you want to change the test data, you need to separate the test data and use parameterization
17. Data driven: after the use case is written, you only need to maintain the test data
Step 4: college stage
18. Encapsulation: if you are proficient in the method, you need encapsulation.
19.jenkins: if you want to execute the use case with one click, you need to use jenkins for continuous integration
20. Code warehouse: multi-person execution of automation projects, code synchronization, it is necessary to use svn, git tools
Step 5: graduate stage
21.js: after learning selenium before, you will also find problems, such as: the browser scroll bar, many scenes can not be completed by selenium, you need to learn js.
twenty-two。 Endless learning: further in-depth learning according to personal research direction.
Selenium learning is easy to make people feel tired, many tests will fail for no reason, let these tests get the correct results is a very tedious work, repetitive boilerplate code is not interesting, then it is necessary to explore their own interest, let the test become happy. I summed up a little skill, that is, association, or relevance thinking. Associations help to summarize what you have learned and deduce new knowledge when needed. Lenovo the reality of the same type of business, there may not be much to associate at the beginning, but a long time will be good, I hope you, I can get closer and closer to the dream!
The above is all the contents of the article "how to learn selenium". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.