zoukankan      html  css  js  c++  java
  • CasperJS断言

    特征 

    CasperJS具有一系列特征。 它具有一些列功能与断言,都是你期望一个好的测试API所具有的,包括:

    * assertTextExists (文本存在断言)
    * assertTitle (标题断言)
    * assertHttpStatus (HTTP状态断言)
    * assertDoesntExist (不存在断言)
    * assertUrlMatch (Url匹配断言)

    this.test.assertExists(
        {type: 'xpath', path: '//input[@id="FullName"]' },
        'the element exists'
    );
     
    this.test.assertExists(
        {type: 'xpath', path: '//input[@id="Company"]' },
        'the element exists'
    );
     
    this.test.assertExists(
        {type: 'xpath', path: '//input[@id="Email"]' },
                    'the element exists'
    );
     
    this.test.assertExists(
        {type: 'xpath', path: '//input[@id="Password"]' },
        'the element exists'
    );
     
    this.test.assertExists(
        {type: 'xpath', path: '//input[@id="PromoCode"]' },
        'the element exists'
    );

    在上面的五个断言中,我查找了五个输入域控件,它们的ID分别是‘FullName’, ‘Company’, ‘Email’, ‘Password’ 和‘PromoCode’。用XPath查找选择列表控件元素同样容易。

  • 相关阅读:
    局域网主机A向主机B发送ip数据报的过程
    用户使用浏览器访问万维网经历的步骤
    sql
    PMP:总概
    LINQ
    下拉框
    PMP:项目采购管理
    PMP:项目风险管理
    PMP:沟通管理。相关方管理
    PMP:项目资源管理
  • 原文地址:https://www.cnblogs.com/c-x-a/p/7268838.html
Copyright © 2011-2022 走看看