Watir-webdriver
Automated Test Solution Book
System architecture
The automated testing framework is divided into three modules: test use case, control layer, Tools tool class, Index master control.
Test use case
- Ruby-based Watir-webdriver development
- 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)
- Unified output rules, such as: ①[info]②tistone③login successful! ④001011
①[info]: On behalf of the use case executed successfully! [ERROR] stands for failure! [Warn] represents a warning!
②tistone: Represents the execution case name
③login successful! : Describes or captures the value values to "! "End
④001011: Return code
4. Uniform use case name, should be consistent with output ②
Control layer
- A use case corresponds to a control
- Validation output, determine the success or failure of the use case, according to the rules associated Linux server capture related logs, configuration files and other reasons for analysis failure, reduce the location area range.
- Compare data, correlate MySQL query data, and compare Web Capture value.
Tools Tool Class
- Package Tool Class
- Associating Linux with MySQL
- Provides test case support to reduce the difficulty of use case development
Index Total Control
- Control case execution and presentation
Scenario Design test use case
Involves dependencies:
' Watir-webdriver ' 'watir-webdriver-performance'
The page covers:
Element capture
Details Visible: http://www.cnblogs.com/Javame/p/4045229.html
Page Load Performance monitoring
1. Times do B.goto ("https://192.168.10.1/web"= b.performance.summary[ : response_time]/1000"Load Time: #{load_secs} seconds. " End
Identification of functional success
ifB.text.include?'t_100m' #capturing web Properties value values #subsequent operationsputs"①[info]②tistone③login successful! 000000" Else #subsequent operations #Output error codeputs"①[error]②tistone③login failed! 001011"End
Parametric extraction
class Basicnumber def Initialize (number,name) = Number = name end def Add (x) + x endend
Control layer
Involves dependencies:
' linux.rb ' 'mysql.rb'
The specific implementation needs to be discussed with Tianlirong to discuss the testability of the specific business logic.
Tools Tool Class
Involves dependencies:
' Net/ssh ' 'scp/ssh'"test/unit"
Associating Linux
#ip/user name/passwordHost="192.168.48.233"username="Root"Password="Root"#calling the Linux commandserver_cmd1='Tail-1000/home/log/web.log | grep ERROR'Server_shell='sh/home/wyong/w.sh'
Associated MySQL
Specific implementation of a slightly ...
Unit Test
class Tc_mytest < test::unit::testcase def test_add n=basicnumber.new (Ten ) assert_equal (134,n.add (4),"This test" on theadd is failure! " ) EndEnd
Index Total Control
Involves dependencies:
Load Control_ use case name. RB'
Unified invocation
t == t.public_methods.grep (/^test_/|test| T.send (test) End
Page Show
involves a Ruby Web development framework that needs to be developed later
Watir-webdriver Automation test scheme based on Ruby