qtp if - download.51testing.comdownload.51testing.com/wenzhang/51testing_ceshitiandi44_1.pdf ·...

Download QTP IF - download.51testing.comdownload.51testing.com/wenzhang/51Testing_ceshitiandi44_1.pdf · 这些模块,在博为峰网校我也录制了专门的课程 ... Smoke test for

If you can't read please download the document

Upload: lammien

Post on 28-Mar-2018

382 views

Category:

Documents


13 download

TRANSCRIPT

  • ( )

    Python Unit test .......01

    ...19

    ...24

    ...........................30

    ...32

    ...........................46

    67

    ....70

    QTP IF ..82

    4 86

    ....................89

    91

    97

  • 1

    51 ()

    www.51testing.com

    Python PywinautoPymousePykeyboardSelenium

    Windows Browser

    Python

    Unittest Unit test Framework

    HTMLTestRunner

    Unittest Selenium Pywinauto

    HTMLTestRunner

    Unittest

    1 UnitTest

    Python Unit Test

  • 2

    51 ()

    www.51testing.com

    2

    HTMLTestRunner

    Unittest HTMLTestRunner

    unittest

    1unittest

    unittest

    setUp() tearDown()

    test case test Case

    2unittest

    https://docs.python.org/2/library/unittest.html

    unittest Python

    3unittest

    1) Test fixture()

    TestCasesetUp tearDown

    setup TestCase tearDown

    https://docs.python.org/2/library/unittest.html

  • 3

    51 ()

    www.51testing.com

    2) Test case

    Test case Unittest

    Test case test cases.

    3) Test suite()

    Test suit test case test cases

    4) Test runner

    Test runner

    4

    1) Test Case

    a. TestCase

    Classes and Functions

    TestCase setUp() tearDown() input

    user

    test fixture

    b. TestCase C:\Python27\Lib\unittest\case.py

  • 4

    51 ()

    www.51testing.com

    c. TestCase

    d.

    setUp 3

    a)

    b) pass

    c)

    tearDown 3

    a)

    b) pass

    c)

  • 5

    51 ()

    www.51testing.com

    e.

    2) TestSuite

    a. TestSuite

    Grouping Testing

    addTest()

    b. TestSuite C:\Python27\Lib\unittest\suite.py

    BasicTestSuite TestSuite TestSuite

    BasicTestSuiteTestSuiteBasicTestSuiteTestSuiteFunction

  • 6

    51 ()

    www.51testing.com

    c. TestSuit

    test case

    addTest(self, test)

    test case addTest TestCase

    addTest input parameter unittest ()

    testsuite.addTest(test_class("test_Data_Roaming"))

  • 7

    51 ()

    www.51testing.com

    1

    1) test

    2) unittest

    3) if __name__ == "__main__":

    unittest.main()

    4)

  • 8

    51 ()

    www.51testing.com

    5)

    test_Enable_Logging, test_Log_Category_All,

    test_Log_Category_Network

    2

    1)

    2)

    3) testsuite=unittest.TestSuite ()

    testsuite.addTest(test_smoke_test("Status_3G"))

    testsuite.addTest(test_smoke_test("PIN_On"))

    4)

    5)

    Status_3G, PIN_On

    3

    1)

    2)

  • 9

    51 ()

    www.51testing.com

    3) testsuite1=unittest.makeSuite()

    testsuite.addTest(test_smoke_test,"Time")

    testsuite.addTest(test_smoke_test,"PIN")

    testsuite=unittest.TestSuite(testsuite1,testsuite2)

    4)

    5)

    unittest.TestSuite(testsuite1,testsuite2)testsuit

    PIN_Off, PIN_On, Time_Zone_INDEX_Daylight_0,

    Time_Zone_INDEX_Daylight_10, Time_Zone_INDEX_Daylight_12,

    Time_Zone_INDEX_Daylight_2, Time_Zone_INDEX_Daylight_9

    Unittest

    1

  • 10

    51 ()

    www.51testing.com

    2

    (:E ) smoke test for AP

    () Advanced Internet

    LAN item LAN .py

    function

    __init__.py py ,

  • 11

    51 ()

    www.51testing.com

    Smoke test for AP smoketest.py

    init.py

    DHCP LAN Setting

    3

    3 smoketest.py constant.py HTMLTestResult.py

    ()

    1) smoketest.py

  • 12

    51 ()

    www.51testing.com

    smoketest.py

    # coding=utf-8

    #

    import HTMLTestRunner,unittest,time,sys,os

    from selenium import webdriver

    from LAN import DHCP

    #

    sys.path.append(os.path.dirname(__file__))

    driver = webdriver.Firefox()

    driver.implicitly_wait(30)

    driver.get("http://192.168.1.1/")

    driver.find_element_by_id("txtUserName").clear()

    driver.find_element_by_id("txtUserName").send_keys("admin")

  • 13

    51 ()

    www.51testing.com

    driver.find_element_by_id("txtLoginPwd").clear()

    driver.find_element_by_id("txtLoginPwd").send_keys("admin")

    driver.find_element_by_name("button.login.users.home").click()

    # Web UI

    class test_smoke_test(unittest.TestCase):

    def setUp(self):

    pass

    #DHCP

    def DHCP_Settings(self):

    DHCP.DHCP_Settings(self,driver)

    def DHCP_Function(self):

    DHCP.DHCP_Function(self,driver)

    def DHCP_Reservation_Add(self):

    DHCP.DHCP_Reservation_Add(self,driver)

    def DHCP_Reservation_Edit(self):

    DHCP.DHCP_Reservation_Edit(self,driver)

    def DHCP_Reservation_Delete(self):

    DHCP.DHCP_Reservation_Delete(self,driver)

    def tearDown(self):

    pass

    # DHCP

    if __name__ == "__main__":

    testsuite=unittest.TestSuite()

    testsuite.addTest(test_smoke_test("DHCP_Settings"))

    testsuite.addTest(test_smoke_test("DHCP_Function"))

    testsuite.addTest(test_smoke_test("DHCP_Reservation_Add"))

    testsuite.addTest(test_smoke_test("DHCP_Reservation_Edit"))

    testsuite.addTest(test_smoke_test("DHCP_Reservation_Delete"))

    #

    # report

    filename="E:\\Selenium\\Auto test for AP\\results.html"

    fp=file(filename,'wb')

  • 14

    51 ()

    www.51testing.com

    #

    runner=HTMLTestRunner.HTMLTestRunner(stream=fp,title='Result',description='Test_Report')

    # HTMLTestRunner

    runner.run(testsuite)

    #

    2) constant.py

    35

    Constant.py

    #LAN

    DHCP_Reservation_host_name_add_edit='44:37:e6:6b:88:63'

    DHCP_Reservation_IP_address_add='192.168.2.10'

    DHCP_Reservation_IP_address_edit='192.168.2.22'

    DHCP_Reservation_IP_address_delete='192.168.2.26'

    DHCP_Reservation_host_name_delete='40:16:9f:95:22:4f'

    #

    def get_DHCP_Reservation_host_name_add_edit():

    return DHCP_Reservation_host_name_add_edit

  • 15

    51 ()

    www.51testing.com

    def get_DHCP_Reservation_IP_address_add():

    return DHCP_Reservation_IP_address_add

    def get_DHCP_Reservation_IP_address_edit():

    return DHCP_Reservation_IP_address_edit

    def get_DHCP_Reservation_IP_address_delete():

    return DHCP_Reservation_IP_address_delete

    def get_DHCP_Reservation_host_name_delete():

    return DHCP_Reservation_host_name_delete

    #,

    Username='admin'

    Password='admin'

    def get_Username():

    return Username

    def get_Password():

    return Password

    3)

    DHCP specify the number of devices/computers in your

    network Apply

    from selenium.webdriver.support.ui import Select

    import time

    testcase=__name__.encode('utf-8')

    #DHCP

    def DHCP_Settings(self,driver):

    driver.find_element_by_id("lan_menu_img").click()

    # LAN LAN

    driver.find_element_by_link_text("DHCP").click()

    # DHCP DHCP

    driver.find_element_by_id("num_devices").clear()

    # ""Specify the number of devices/computers in your network"

  • 16

    51 ()

    www.51testing.com

    driver.find_element_by_id("num_devices").send_keys("18")

    # 18

    driver.find_element_by_name("button.apply").click()

    # apply,

    after_set1=driver.find_element_by_id

    ("number_devices").get_attribute("value")

    self.assertEqual(after_set1,"18")

    #

    HTML

    1 HTMLTestRunner.py

    http://www.51testing.com/html/12/n-3715212.html

    http://www.51testing.com/html/12/n-3715212.html

  • 17

    51 ()

    www.51testing.com

    2

    c:\python27\lib smoketest.py

    3 import HTMLTestRunner

    4 unittest.main()

    testsuite=unittest.TestSuite()

    testsuite.addTest(test_class("test_Data_Roaming"))

    filename="E:\\re\\results5.html"

    fp=file(filename,'wb') runner=HTMLTestRunner.HTMLTestRunner(stream=fp,title='Result',desc

    ription='Test_Report')

    runner.run(testsuite)

    Unittest HTMLTestRunner

    Unittest

    test case

    HTMLTestRunner

  • 18

    51 ()

    www.51testing.com

    Python

    http://www.atstudy.com/course/158

    1) Python http://www.python.org/getit/

    2) UnitTest https://docs.python.org/2/library/unittest.html#

    ()

    3) HTMLTestRunner https://pypi.python.org/pypi/HTMLTestRunner

    http://www.atstudy.com/course/158

  • 19

    51 ()

    www.51testing.com

    1

    a

    b.

    c.

    d.

    20% 80%

    2

    1)

    2)

  • 20

    51 ()

    www.51testing.com

    3)

    3

    4

    1

  • 21

    51 ()

    www.51testing.com

    2017

    a.

    b.

    c.

    d.

    2

    -

  • 22

    51 ()

    www.51testing.com

    3

    100

    4

    1)

    2)

  • 23

    51 ()

    www.51testing.com

    3)

    4)

    5W

    XX

    python

    bug

    5

    25

    X

    5 4

    6

    1)

    2)

    3)

    app

    iphone

    Onenote

    outlook

  • 24

    51 ()

    www.51testing.com

  • 25

    51 ()

    www.51testing.com

    1.

    1

    2

    2.

  • 26

    51 ()

    www.51testing.com

    3

    3.

    4

    4./

    5

    6

    7

    8

    9

    config.xml commcfg.xml

  • 27

    51 ()

    www.51testing.com

    pingback

    UI

    1

    Window + M

    2

  • 28

    51 ()

    www.51testing.com

    icon

    3

    4

  • 29

    51 ()

    www.51testing.com

  • 30

    51 ()

    www.51testing.com

    APP

    pc web APP

    APP

    APP

  • 31

    51 ()

    www.51testing.com

    app ...

    app

    APK

    webpage url

  • 32

    51 ()

    www.51testing.com

    spark Flink

    Netezza

    (HadoopsparkFlink) JVM

    JVM

    1Java

    2Major GC (Java )

    FlinkSparkHadoop

    .

    Alexey Grishchenko blog

    Java

    80/20

    1 vs /

    cpu

    2-reduce map-reduce

    yonger

  • 33

    51 ()

    www.51testing.com

    reducejoinreduce key join

    3-reduce

    4- map job . reduce

    reduce map

    hashmap

    hashmap

    map Pig

    merge-joins lock-step

    map ()

    reduce

    JVM

    Java

    1Java

    2

    Major GC

    JVM JVM

    ()..

    reduce

    reduce

    .

    .

    .

  • 34

    51 ()

    www.51testing.com

    Pig DataBag Pig

    tuples ( 20000)

    JVM

    Java -

    1.-.Hotspot VM 8

    4

    2.-. boolean 1 char

    int 4

    3.- 4

    4.- 8

    1 Java boolean 8

    boolean 7

    1: boolean java

    java hashmap list

    JVM

    1Mapper

    2Mappers map

    3Reducers mapper

  • 35

    51 ()

    www.51testing.com

    Java

    L1/L2/L3

    JVM GC

    JavaGC . Java

    20% 80%

    minorGC

    major GC Major

    GC

    JVM OOM

    Map-Reduce

    I/O

    MR

    Spark RDD

    I/O

    GC Spark

    Java

    Java java.io.Serializable

    metadata meta-data

    Java

    Java.io.Externalizable

    java.io.Externaizable

  • 36

    51 ()

    www.51testing.com

    Java.io.Serializable java.io.Externaizable

    java

    GC

    Kryo Spark Java Kryo

    Kryo

    Kryo

    Kryo

    Hadoop

    org.apache.hadoop.io.Writable

    Spark Flink

    .

    java.io.Serializable

    java.io.Externalizable

    setMapperOutputKeyClasssetMapperOutputValueClasssetOutputKeyClass

    setOutputValueClass Hadoop MapReduce

    2 GC

  • 37

    51 ()

    www.51testing.com

    2Java

    -

    1

    (SparkFlink) sun.misc.Unsafe

    2-

    Major GC

    Hbase Flink major GC

    3-

    CPU

  • 38

    51 ()

    www.51testing.com

    CPU

    CPU

    ( Reduce

    )

    Hadoop

    org.apache.hadoop.io.Textorg.apache.hadoop.io.BinaryComparable

    4- Java NIO sun.misc.Unsafe

    Java Java

    GC Java GC

    HBase Spark

    Flink

    -

    1 schema()

    2( Spark )

    getXXX .

    .

    CPU

    Hadoop -org.apache.hadoop.io.Writable

    2

    Spark -Project Tungsten

  • 39

    51 ()

    www.51testing.com

    Spark Java Kryo Spark

    (Kryo

    4 )

    Project Tungsten

    Project Tungsten

    Spark -

    1 schema (

    )

    2

    schema

    slide

    Tungsten .

    Blog

    Kryo

    ()

    Flink

    Flink . Spark Flink

    Java Scala hadoop

    Flink Scala Scala

    FlinkTypeInformation

    Java java.lang.string

  • 40

    51 ()

    www.51testing.com

    Java java.lang.String

    Hadoop Writable

    Flink Flink Java

    Scala CaseClass ( Scala )

    POJO(Java or Scala) public

    getter setter

    TypeInformationGenericTypeInfo

    TypeInformation Kryo -Flink

    TypeInformation

    TypeComparators key . TypeInformation

    Flink API TypeInformation

    .

    TypeInformation Flink (

    MemorySegment) JavaUnsafe .

    Flink

    majorGC.

    Major GC -

    major GC.

    .

    HBase

    Spark Flink HBase

    Spark

    Flink .

  • 41

    51 ()

    www.51testing.com

    HBase Memstore

    HBase MemStore 2MB Cloudera

    - Apache HBase MemStore Full GCs-

    Java HBase Java

    HBase :

    1) HBase key-value key-value

    2) key-value key-value

    .

    3) key-value HBase MemStore

    MemStore

    Memstore blog

    4) Memstore 2MB key-value

    2MB key-value

    2MB

    GC 2MB

    2MB 2000

    1KB 2MB .

    Flink

    Flink HBase Flink Java 3

    -

    - 2048 Flink 32KB

    taskmanager.network.numberOfBuffers

    - MemoryManager 32KB .

    MemorySegment MemoryManager

    MemorySegments MemoryManager MemorySegment

    70%

  • 42

    51 ()

    www.51testing.com

    - GC

    .

    -

    1)

    2) 32KB 32KB GC

    MemoryManager

    MemorySegment

    3)

    .

    MemorySegment

    3 Flink

    3Flink

  • 43

    51 ()

    www.51testing.com

    32KB GC

    major GC

    major GC .

    Flink . -

    majorGC

    MemoryMnager

    CPU L1/L2/L3

    CPU

    sort-key+pointer CPU

    Flink

    Flink Flink

    Flink

    1

    Flink .

    -

    2

  • 44

    51 ()

    www.51testing.com

    -

    Flink

    org.apache.hadoop.ioText

    .

    Spark -Project Tungsten

    Spark Flink blog

    Java Java

    JAVA

    OutOfMemoryError

    Java java.nio sun.misc.misc.Unsafe

    Terracotta BigMemory BigMemory 1 G

    OpenHFT Chronicle Library

    HBase Block Cache .

    Flink MemoryManager

    Spark Tachyon

    LargeCollections LevelDB Hashmap

    https://github.com/sameeraxiomine/LargeCollections

  • 45

    51 ()

    www.51testing.com

    LevelDB C++ JNI

    MPP JAVA

    JAVA C

    1/

    2CPU

    org.apache.hadoop.io.Text

    org.apache.hadoop.io.Text

    3

    4 Map-Side

    Mapper Reduce

    ()

    LargeCollections Usafe NIO

    Hashmap

    org.apache.hadoop.io.Writable types

    Serializer/De-Serializer (SerDe) Java

    Java

    C

    https://github.com/sameeraxiomine/LargeCollections

  • 46

    51 ()

    www.51testing.com

    APP Lisiya wifi wifi

    Lisiya APP APP

    Lisiya APP APP

    Lisiya

    Lucherian

    Lucherian Lisiya

    Test case

    1 wifi

    2

    3

    4

    5- -

  • 47

    51 ()

    www.51testing.com

    6- -

    7

    (Lisiya

    Christina )

    Lisiya

    Christina Lisiya Victoria

    Victoria Lisiya Lisiya Christina

    Christina

    Lisiya

    Lisiya

    Lisiya

    Christina

    Christina

    Christina

    !

    liyiya Lucherian

  • 48

    51 ()

    www.51testing.com

    Lisiya

    Lisiya wifi

    wifi

    Lisiya

    Lisiya

    Lucherian

    Lucherian

    Lucherian 24

    Lisiya

    --

    300

    Lisiya

    Lisiya

    LisiyaLisiya

    Lisiya

    Lisiya

  • 49

    51 ()

    www.51testing.com

    Lisiya

    wifi

    Lisiya app

    Lisiya APP

    wifi wifi Wifi

    wifi wifi

    wifi wifi

    Lisiya

    Lisiya wifi

    APP

    24 Lisiya

    Lisiya

    Lisiya wifi

  • 50

    51 ()

    www.51testing.com

    wifi

    wifi

    wifi

    WIFI

    1)

    2) wifi

    3)

    4) wifi wifi

    WIFI

    5) wifi

    6) wifi

    7)

    8)

    WIFI WIFI

    WIFI

    Lisiya

    WIFI 300

    WIFI WIFI APP

  • 51

    51 ()

    www.51testing.com

    WIFI WIFI WIFI WIFI

    300

    WIFI

    Lisiya

    ?

    Lucherian Lisiya

    Lisiya

    Lisiya

  • 52

    51 ()

    www.51testing.com

    300

    Lisiya Liyiya

    Lisiya

  • 53

    51 ()

    www.51testing.com

    Lisiya

    Lisiya 5

    5

    Lisiya wifi

    wifi 5 5

    wifi wifi

    5 wifi 5

    5

    5 wifi

    wifi 5

    Lisiya 5

    bug

    APP

    5

    5

    5 5

    7

  • 54

    51 ()

    www.51testing.com

    Lisiya 5 5

    Lisiya

    Lisiya

    cookie cookie

    cookie

    Lisiya

    android ios windows

    linux

    SQL

    Lisiya

    Lisiya

    1--

    x y

    2

    Lisiya

    1

    1

  • 55

    51 ()

    www.51testing.com

    1* 2*

    1

    2

    3

    4

    5 sigma

  • 56

    51 ()

    www.51testing.com

    2

    1

    2

    3

  • 57

    51 ()

    www.51testing.com

    Lisiya

    LoadRunnerJmeter

    Lisiya Jmeter Jmeter

    Jmeter

    5

    1 JMETER

    2 ....../jmeter/bin/user.properties

    proxy.cert.alias=anything

    Jmeter

    1

    ->->Threads(Users)->

  • 58

    51 ()

    www.51testing.com

    2

    200Ramp-up period(in second):10

    10

  • 59

    51 ()

    www.51testing.com

    3 HTTP

    ->->->HTTP

  • 60

    51 ()

    www.51testing.com

    4 HTTP 8080 8080

  • 61

    51 ()

    www.51testing.com

    5

    ->->->Response Time Graph

    6 Summary Report

    ->->->Summary Report

    7 8080

    Firefox

  • 62

    51 ()

    www.51testing.com

    8->HTTP ->

    9 Firefox http://bbs.****.com/search.php

  • 63

    51 ()

    www.51testing.com

    22,

    10 HTTP

    11 Jmeter

    /search.php?mod=forum http

  • 64

    51 ()

    www.51testing.com

    12 report report

    Summary report

    13 Response Time

  • 65

    51 ()

    www.51testing.com

    14

    -> html html

  • 66

    51 ()

    www.51testing.com

    Lisiya Jmeter Jmeter

    http://www.atstudy.com/course/183

    Jmeter Jmeter

    http://www.atstudy.com/course/183

  • 67

    51 ()

    www.51testing.com

    1)

    2)

    3) --

    1) 5

    2)

    3)

    4)

    5)

    6)

    7)

    1)

  • 68

    51 ()

    www.51testing.com

    Appium

    Android

    2)

    todo

    3)

    windbg

    PM

  • 69

    51 ()

    www.51testing.com

    fiddler

    4)

    5) Bug

    bug

    6)

    7)

    8)

    9)

    1python

    2

    3

  • 70

    51 ()

    www.51testing.com

    1

    QPS 100

    QPS

    100

    QPS 50

    redis redis

    mysql mysql

  • 71

    51 ()

    www.51testing.com

    redis

    mysql

    QPS

    QPS

    QPS

    QPS

    =((80%* PV )/(24 *60 *60 *40%)) /

    80%40% 80% 40%

    24 40% 9.6 80% 9.6

    ((80%*500 )/(24 *60 *60 *40%))/1 = 115.7 /

    2

    :1

    2 js

    3

    QPS

  • 72

    51 ()

    www.51testing.com

    3

    4

    1)

    3 30% cpu

    cpu 70%

    2) linux

    http://www.51testing.com/html/13/n-3715213.html

    3)

    5

    200

    response

    response

    200

    http://www.51testing.com/html/13/n-3715213.html

  • 73

    51 ()

    www.51testing.com

    15K json

    log

    log

    6

    if for

    7

    linux

    LoadRunner LoadRunner

    HPSTPSresponsetime cpu IO IO

    agent

    8&&

    CPU

    CPU

    CPU IO

    -

    --web

    -SQL

  • 74

    51 ()

    www.51testing.com

    OK

    (9)

    cpu IO IOTPSresponsetime

    +

    leader leader leaderPM

    1

    XXX

    XXX

  • 75

    51 ()

    www.51testing.com

    XXX

    2

    &

    XXX X XXX

    \

    XXX X XXX

    XXX X XXX

    XXX X XXX

    XXX X XXX

    3

    XXX &

    XXX &&

    XXX &

    /

  • 76

    51 ()

    www.51testing.com

    &

    1h

    8.58.6

    a)

    b) Loadrunner

    c) 20 2 20 / 1000/ 30

    d) TPSserver CPU

    e)

    input1

    +

    leader leader leaderPM

  • 77

    51 ()

    www.51testing.com

    300QPS charge/list.html

    QPS

    QPS

    QPS

    Pay 550

    Charge 65

    Detail/index 2000

    Usercenter 300

    1500

    Charge charge/index.htmldo.htmllist.html QPS 60

    charge/list.html 2s

    HPS

    HPS300

    CPU

  • 78

    51 ()

    www.51testing.com

    cpu 20%

    Mem

    free 0 linux

    Response time

  • 79

    51 ()

    www.51testing.com

    response time 1s

    charge QPS charge

    1. Detail 404

    resin jvm Xms

    PermSize 404

    2. detailshop QPS 10 shop 404

    response time 5s

    5s

    sql

    QPS 140

    3. pay charge order 5s

    QPS 200

  • 80

    51 ()

    www.51testing.com

    /

    CPUCore 32

    128G

    Linux

    1

    1h

    a)

    b) Loadrunner

    c) 20 2 20 / 500/ 30

  • 81

    51 ()

    www.51testing.com

    d) TPSserver CPU

    e)

  • 82

    51 ()

    www.51testing.com

    If-Else If-Else-End If

    -----------------------------------------------------------------------------------------

    Function [If](ByVal strExpression, ByVal strDoIfTrue, ByVal dicElseIf, ByVal strDoIfFalse)

    -----------------------------------------------------------------------------------------

    1. strExpression

    2. strDoIfTrue strExpression

    3. dicElseIf -

    IF Else [Select

    Case]

    4. strDoIfFalse strExpression

    VBScript

    IF [IF]

    QTP

    IF

  • 83

    51 ()

    www.51testing.com

    -----------------------------------------------------------------------------------------

    Function [If](ByVal strExpression, ByVal strDoIfTrue, ByVal dicElseIf, ByVal strDoIfFalse)

    [If] = Eval(strExpression)

    If([If])Then

    PrintLog("If", "Executing " & strDoIfTrue)

    Execute(strDoIfTrue)

    ElseIf ([Select Case](dicElseIf)) Then

    PrintLog("If", "Executed ElseIf")

    Else

    PrintLog("If", "Executing " & strDoIfFalse)

    Execute(strDoIfFalse)

    End If

    End Function

    -----------------------------------------------------------------------------------------

    [IF][Select Case](

    )

    -----------------------------------------------------------------------------------------

    Function [Select Case](ByVal dicCases)

    Dim [Case], [Cases]

    [Select Case] = False

    If (Not TypeName(dicCases) = "Dictionary") Then

    PrintLog("Select Case", "Nothing to do")

    Exit Function

    End If

    If (dicCases.Count = 0) Then

    PrintLog("Select Case", "Nothing to do")

    Exit Function

    End If

    [Cases] = dicCases.keys

    For each [Case] in [Cases]

    [Select Case] = Eval([Case])

    If([Select Case])Then

  • 84

    51 ()

    www.51testing.com

    PrintLog("Select Case", "Executing " & dicCases([Case]))

    Execute(dicCases([Case]))

    Exit For

    End If

    Next

    End Function

    -----------------------------------------------------------------------------------------

    PrintLog

    UFT

    -----------------------------------------------------------------------------------------

    Function PrintLog(ByVal strStepName, ByVal strDetails)

    Print(strStepName & " - " & strDetails)

    Reporter.ReportEvent micDone, strStepName, strDetails

    End Function

    -----------------------------------------------------------------------------------------

    Dim arrTemp, i

    Dim dic

    Dim Condition, IfIsTrue, IfIsElseIf, IFIsFalse

    Set dic = CreateObject("Scripting.Dictionary")

    Condition = "arrTemp(i)>70"

    IfIsTrue = "PrintLog(Now()&"" Wear a T-Shirt!"")"

    Set dic = CreateObject("Scripting.Dictionary")

    dic.Add "arrTemp(i)>60", "PrintLog(arrTemp(i)&"" Wear a hat!"")"

    dic.Add "arrTemp(i)>50", "PrintLog(""Testing [If]"", arrTemp(i)&"" Wear a long-sleeved shirt!"")"

    Set IfIsElseIf = dic

    IfIsFalse = "Wscript.Echo(Now()&"" Wear a coat!"")"

    arrTemp = Array(50, 55, 60, 65, 70, 80)

    For i = LBound(arrTemp) To UBound(arrTemp)

    PrintLog("Testing [If]", "Temperature is " & arrTemp(i) & ": " & [If](Condition, IfIsTrue, IfIsElseIf,

    IfIsFalse))

    Next

  • 85

    51 ()

    www.51testing.com

    -----------------------------------------------------------------------------------------

    (UFT )

    Testing [If] Temperature is 50: Wear a coat!

    Testing [If] Temperature is 55: Wear a long-sleeved shirt!

    Testing [If] Temperature is 60: Wear a long-sleeved shirt!

    Testing [If] Temperature is 65: Wear a hat!

    Testing [If] Temperature is 70: Wear a hat!

    Testing [If] Temperature is 80: Wear a T-Shirt!

  • 86

    51 ()

    www.51testing.com

    4

    51Testing

    4

    2012 -2015

    2012

    2000 10

    2-4

    leader

    3

    leader

    3

  • 87

    51 ()

    www.51testing.com

    20

    ......

    3500

    team

    2

    2015

    web

    B/S B PC

    B

    2016

    web

  • 88

    51 ()

    www.51testing.com

    APP

    Web

    Windows

    Linux Linux

    windows

    low

    casecase reviewcode review

    reviewQA

    over

    web web

    51Testing

    51Testing

    51Testing

  • 89

    51 ()

    www.51testing.com

    2009

    V X H

    Scrum

    Scrum ATDD, BDD, TDD

    Scrum Sprint

    Bug

    Sprint

    Sprint 1 22 22

    1 7 7 14

    15 22

    Sprint Sprint

    http://www.51testing.com/html/03/n-112703.html

  • 90

    51 ()

    www.51testing.com

    100%

    Sprint

    Sprint

    Sprint

  • 91

    51 ()

    www.51testing.com

    linxuan

    :

    ()

    HSF/Http bug

    /

    1.

    /

  • 92

    51 ()

    www.51testing.com

    2. /

    3.

    CoberturaEmmaJacocoJmockit

    Jacoco java

    Jacoco

    Junit + Jmockit + Jacoco Jmockit

    mock Jacoco

    POM jacoco maven

    Maven Jacoco

  • 93

    51 ()

    www.51testing.com

    mvn clean test

    html

    Jacoco API

    /UI

    Jacoco Java agent

    agent placeholder.sh

  • 94

    51 ()

    www.51testing.com

    jacocoagent.jar package

    Jacoco Jacoco Agent agent

    placeholder.sh

    Jacoco API

    Jacoco SDK

    TCP Socket

  • 95

    51 ()

    www.51testing.com

    HTML classes

    1. clone

    2. war clasess

    Jenkins

    Jenkins Jacoco

    :

  • 96

    51 ()

    www.51testing.com

    jenkins

    http://www.atstudy.com/course/40http://www.atstudy.com/course/40

  • 97

    51 ()

    www.51testing.com

    SRS SRS

    SRS

    excel

    Lily

  • 98

    51 ()

    www.51testing.com

    SRS

    IEEE ISO

    1)

    2)

    1) BVT

    2)

    3)

    4)

    5)

    6) -

    7)

  • 99

    51 ()

    www.51testing.com

    1)

    2)

    3) BVT

    4)

    5)

    6)

    1)

    2) -

    3)

    4)

    5)

    6)

    7)

    51

    -

    -

    -

    - UFT

    -

    -

    -

    -

    - QTP

    -

    -

    - JavaScript -Mocha+chai

    -

    http://download.51testing.com/wenzhang/51Testing_ceshitiandi44_2.pdf