• Java Script 学习笔记 (二) Casper JS


    1. click() VS mouse.click()

        在写自动化脚本要勾选一个复选框时,用casper.mouse.click() 无法选上这个checkbox, 需要用到casper.click()才可以。但是同事那里用哪种写法都可以, 我们同样都是在test子命令下执行的脚本。

    1     casper.then(function(){
    2         this.mouse.click("#root > div > form > div:nth-child(8) > div > div > label > span.ant-checkbox > input");
    3     });
    4     casper.then(function(){
    5         this.capture("test-demo0.2-"+(captureIdx++)+"-wrongreg2.png");
    6     });
    View Code

      上面这段脚本得到的截图:
      

     

      

    1     casper.then(function Initial(){
    2         this.click("#root > div > form > div:nth-child(8) > div > div > label > span.ant-checkbox > input");
    3     });
    4 
    5     casper.then(function Cap(){
    6         this.capture("test-demo0.2-"+(captureIdx++)+"-wrongreg2.png");
    7     });
    View Code

    上面这段脚本得到的截图:

  • 相关阅读:
    RSA
    antd 规则检查
    antd 使用总结问题
    react context prop-types
    【CSS/JS】如何实现单行/多行文本溢出的省略(...)
    react prop-types
    js 监听URL的hash变化
    Spark 读取Hadoop集群文件
    HIVE 常见函数
    Linux ANSI转 UTF8
  • 原文地址:https://www.cnblogs.com/cheese320/p/8067782.html
Copyright © 2020-2023  润新知