then the Watir-webdriver Automation test scheme and implementation based on Ruby (I.)Http://www.cnblogs.com/Javame/p/4159360.html continue ... ReviewOverview of software automation testingThe scheme design of web Automation testFunctional Solution DesignBusiness Solution Design
scenario Implementation of Web Automation testing automate the recording and writing of test scriptsimplementation and implementation of automated testingRecovery of test operations and test data
Automated test script design and recording
• Tools: watirrecorder++
Uniform preset parameter input rules, provide a rule template, do a use case a class, a method of one output. (A class can be multiple methods)
• Example one: (Implement hao123, search "Ruby" function)
Require'Watir-webdriver'include Watirrequire'Test/unit'classTc_recorded <test::unit::testcase def test_recorded @@b= Watir::browser.New@@b.Goto('http://www.hao123.com/') @@b.text_field (: Name,'Word').Set('Ruby') @@b.text_field (: Name,'Word').Set('Ruby') @@b.button (: Value,'Baidu a bit'). Click EndEnd
Specific implementation of automated testing
• Implemented in the Tools tool class with Linux, MySQL, and more • • Two: (check whether the black and white list is in effect via Linux)
classLinux <Mysqldef Initialize (host) @ @host=host@ @username="Root"@ @password="Rootmengmeng "def l.gethostreturn@ @hostenddef L.getusernamereturn@ @usernameenddef L.getpasswordreturn@ @passwordend def ACL (IP) @name=IP a="#{@name}"server_cmd1="{echo ' acl-l '; sleep 2; Echo-e ' \ n ';} | telnet 0 1234 | grep #{a}"SSH= Net::ssh.start (L.gethost, l.getusername,:p assword = L.getpassword) Do|ssh|result= ssh.exec!(SERVER_CMD1) @result=result ..... ... .. endattr_writer:host
Software automation testing cost investment and risk analysis
Cost investment in software automation testing
• Cost of maintenance of scripts: Automated test processes that make scripting maintenance a critical basis for automated implementations. For a standardized system development process, it is necessary to automate the testing. But automated script maintenance makes our automated testing more expensive in cost. The development of each system is always changing as the requirements change, but in most cases, it is a tiny bit of system modification that will lead us to a lot of changes to automated test scripts.
(This is why we have to introduce the architecture of the relationship!) )
The benefit of our architecture is that the business is separated from the logic that the page has been updated or modified simply by re-recording or writing new use cases without impacting business results.
Maintenance of scripts for automated tests
• The entire automated test open platform is divided into two parts:
Java Frontend (responsible for data provisioning, initiating with execution)
Ruby Bottom (responsible for the implementation of the business, and the execution of the operation)
• About Maintenance
Java front-End all configuration parameters are dynamic acquisition, late business changes without modification
Ruby Bottom
The test use case layer and control layer need to be maintained over time as demand iterations
The tools layer changes only when there are significant changes to the business
Othe no changes required
Risk analysis of software automation testing
• The reason for the risk: Automated testing is only for the majority of the system's main functions of the effective testing and validation, so that the coverage of the test surface is relatively narrow, resulting in some hidden problems of the system can not be found. • Risk reduction Recommendations: At the beginning of the implementation of automated testing, the design of automated test cases, grasp the key functions of the system and possible problems, and then realize the test automation. Reduce predictable system risk under existing conditions. • Objective: Reduce the risk of predictable system testing under existing conditions.
say at the end of the
1, automation is not fully automatic, need to spend energy to let him automate.
2, automation tools are not omnipotent, he also has his own flaws.
3, automation can never replace the artificial position.
4, the maintenance of automated scripts is sometimes very deadly, need to have some experience to do well.
Watir-webdriver Automation test scheme and implementation based on Ruby (II.)