Ruby-based watir-webdriver Automated Testing Solution and implementation (1), watirwebdriver
Why is automated testing required?
• Objective Requirements for increasingly complex application systems
An inevitable problem is that application systems become increasingly complex and pose greater risks. Testing consumes more and more time. The cost and time are limited. In order to control the quality of released software products within the limited cost and time range, testers are required to test the software in the shortest time.
• Avoid subjective requirements for repeated tests
Iterative development process: the current software development process is more or less iterative, which leads to another round of testing.
Regression testing: to check whether the software version is correct, or when one or more defects have been fixed before, it is inevitable to perform regression testing.
What are the causes of automated testing failure?
1. The expectation is too high. Just as the management personnel require a full test, it is also unrealistic to expect 100% of the test automation. 1. Benefits and Costs of automation:
Cost = case development + case maintenance
Benefits = repeated running times (time) + time saved
What is the growth process of automated testing?
Testing often begins as freestyle, expands toward scripted.
Testing always begins with a free-of-charge exploration and expands towards a scripted approach.
Application timing of automated testing?
Highlights
Test Solution Design
1. process for designing the functional solutions for automated testing:
Operation Object> Object Property> function implementation> result Verification
2. use case diagram of functional solutions for automated testing:
Web object recognition-Watir-WebDriver
• Input box input • button • select • link • click • single choice radio • multiple choice checkbox • analog keyboard send_keys: enter
Open Platform Framework Design for automated testing
Use Case Design Example of the automated testing framework
• 1. ruby-based watir-webdriver development • 2. Unify preset parameter input rules and provide rule templates to implement one use case, one class, one method, and one output. (A class can have multiple methods) • 3. Unified output rules, for example: ① [info] ② TiStone ③ Login successful! ④ 001011
① [Info]: indicates that the use case is successfully executed! [Error] indicates an error! [Warn] indicates a warning!
② TiStone: name of the execution case
③ Login successful! : Description or captured value, with "!" End
④ 001011: return code
• Unified use case name, consistent with output ② • 5. Unified input parameters involved through RubyBean • 6. Unified inheritance of Tools such as browser instantiation, tested system jump, user login, and browser instantiation
Control Design Example of the automated testing framework• 1. A use case corresponds to a Control • 2. Verify the output to determine the success or failure of the case execution. the Linux server is associated with the rule to capture related logs and configuration files to analyze the cause of failure and reduce the scope of the location. • • 3. Compare the data, associate the MySql query data, and compare the value captured by the web.
Tools Design Example of automated testing framework• I. encapsulate common tools • • Linux and MySql business Interfaces • • 3. Object-oriented Implementation of inherited Tools to reduce the difficulty of case development
Model Design Example of the automated testing framework• 1. provides unified execution, single execution, and batch execution modes • 2. associates with the JAVA frontend to implement interaction between the two ends through RubyBean
JAVA front-end design example of automated testing framework• 1. Use the tested system and ruby nodes
Tested system: the system to be tested
Ruby node: supports frontend and underlying ruby Association (optional)
• Case Management
Create case nodes
Provides automated use cases for uploading specified nodes
• User Management
Design Example of the results of the automated testing framework