zoukankan      html  css  js  c++  java
  • 《SeleniumBasic 3.141.0.0

    SeleniumBasic中的Utility类有一个Equals方法,可以判断任意两个变量是否指向同一个实际对象。

    例如百度搜索的文本框和按钮的HTML定义如下

    <input type="text" class="s_ipt" name="wd" id="kw" maxlength="100" autocomplete="off">

    <input type="submit" value="百度一下" id="su" class="btn self-btn bg s_btn">

        WD.URL = "https://www.baidu.com"
        Dim form As SeleniumBasic.IWebElement
        Dim keyword As SeleniumBasic.IWebElement
        Dim button As SeleniumBasic.IWebElement
        Set form = WD.FindElementById("form")
        Set keyword = form.FindElementById("kw")
        Set button = form.FindElementById("su")  
        Dim Utility As New SeleniumBasic.Utility
        Debug.Print Utility.Equals(keyword, button) '返回False
        Debug.Print Utility.Equals(keyword, form.FindElementByName("wd")) '返回True

    上述程序中的keyword和button是两个不同的对象,因此返回False。

    文本框的id是kw,name属性是wd。虽然通过不同的定位方式获取到的,但是是同一个实际对象,返回True。

  • 相关阅读:
    Super Jumping! Jumping! Jumping!
    glsl学习之cube
    取得某个进程CPU的占用率
    在游戏中使用“CEGUI”
    vbo 简单演示
    平行光镜面反射模型
    使用fbo来实现render to texture演示
    平行光漫反射模型
    glsl teapot 简单演示
    点光源模型
  • 原文地址:https://www.cnblogs.com/ryueifu-VBA/p/13712902.html
Copyright © 2011-2022 走看看