Firefox installation Selenium IDE diagram steps
Step 1: Use Firefox browser to enter Selenium official website, address £ http://docs.seleniumhq.org/, click Download Selenium, as shown;
Step 2. Once installed, you can see it in the add-ons in Firefox, as shown in:
After the installation is complete,
Click the red button to record, then save and then end, click the red button to finish recording, then click on the left green to run.
Summary of Experience
As a novice who has not been in touch with selenium before, if you have previous experience writing code, then you will learn faster! But at any rate, it's always hard to start!
I also from a close to pure 24K small white grew up, step by step, in this process I learned a lot of new knowledge, with a new breakthrough, new growth, continuous efforts, constantly try, and constantly experience, let me go to today, the future, there are many ways to go! No hesitation, my test road!
So, today time to review my selenium learning process, that is, selenium automated test How to start, these, is my personal experience, share out for everyone reference!
1. At first, a lot of people started with the Selenium IDE recording script, and so did I. One book is very well written: Selenium Beginner's Guide! So, from recording playback to start my selenium, and in this process, continue to add my HTML CSS knowledge, familiar with selenium api!
2. Slowly, found that the recorded script in the replay often error, through the inspection found that the location of the error, resulting in this location error is the biggest cause of the system's front-end adoption of some kind of framework, such as TIGERUI,EXJ .... So the tags inside the HTML are dynamic, such as Id,class, name! This is a fatal wound to automating the selenium operation of the positioned element!
3. So, start writing your own location information, which is already necessary! Thus learning the xpth and CSS selectors, mastered more effective, fast and stable positioning of the elements on the page (when the positioning will inevitably encounter an IFRAME, which must first switch to the IFRAME and then positioning)! That is, write the script on the Selenium IDE!
4. Confidently write a long script on the Selenium IDE and run it again and again! Finally tasted a little happy taste! Then, the problem comes, when I want to modify and expand the script, only to find that the efficiency is quite low! A sentence to check! A sentence change! What a painful insight!
5. In addition, the selenium IDE is started by default Firefox, the browser will always error when using selenium RC to run the IE running script! All kinds of uncertain, all kinds of not calm! decided to abandon the use of ide!
6. One of the great things about selenium is that it supports multi-language parties: Java,c#,python and so on, and can convert recorded scripts into code! I use Java, decisive walk!
7. Needless to say, of course, the script has been converted into Java code and started again in Eclipse!
8. Select a test framework: there are JUnit and testng two options, the company is using JUnit, so, needless to say, I use JUnit to verify the results of the selenium script! And, both JUnit and testng can generate more intuitive test reports!
9. Write some code, and you'll see that the entire code is filled with the same code: Start encapsulating the code! Use the API to encapsulate them! The code looks much more comfortable after it is packaged!
10. Next, should also be the code in the positioning information with a special file, and then to read the positioning information inside, so that the maintenance code and maintenance of positioning information is placed in two places, do not always stick in the code and location path, simply sub-layer! Try decisively!
11. Here, the script is written out, the common API encapsulation, the location of the path is separated! The whole code is a lot simpler! It's easier and more comfortable to write! At this time, the personalization of their own framework, here, temporarily do not write down, has been away from how to start selenium quite far away! Perhaps, in this step, you have your own idea of the test framework and how to design the script .... Come on, turn your ideas into real power and move on!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Firefox firefox browser install selenium_ide steps and their usage rules