Watir-webdriver Automation test scheme based on Ruby

Source: Internet
Author: User
Tags mysql query

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
    1. Ruby-based Watir-webdriver development
    2. 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)
    3. 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
    1. A use case corresponds to a control
    2. 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.
    3. Compare data, correlate MySQL query data, and compare Web Capture value.
Tools Tool Class
    1. Package Tool Class
    2. Associating Linux with MySQL
    3. Provides test case support to reduce the difficulty of use case development
Index Total Control
    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.