zoukankan      html  css  js  c++  java
  • Watir: Get document detail information in Watir.

    ie.#{element}(:id,"foo").document.currentstyle.attributeAsCamelCase
    so
    ie.#{element}(:id,"foo").document.currentstyle.fontFamily
    ie.#{element}(:id,"foo").document.currentstyle.fontSize
    ie.#{element}(:id,"foo").document.currentstyle.color
    Sometimesyou have to use invoke: 
    ie.#{element}(:id,"foo").document.currentstyle.invoke(attributeAsCamelCase)
    thevisible method works this way:
    ie.#{element}(:id,"foo").document.currentstyle.invoke("display")
    ie.#{element}(:id,"foo").document.currentstyle.invoke("isDisabled")
    
    Find the list of available methods:
    
    ie.#{element}(:id,"foo").document.currentstyle.ole_methods
    
    #puts ie.div(:class,/TopbackgroudTopFont/).document.currentstyle.fontSize
    
    #puts ie.div(:class,/TopbackgroudTopFont/).document.currentstyle.color
    
    #puts ie.div(:class,/TopbackgroudTopFont/).document.currentstyle.backGroundColor
    
    #puts ie.div(:class,/TopbackgroudTopFont/).document.currentstyle.scrollbarBaseColor
    
    Get class name by
    
    puts ie.span(:text,/running/i).class_name
    
    Get the _eventID attribute by:
    
    puts ie.span(:text,/running/i).document.getAttribute("_eventID")
    puts $ie.div(:id,"workout_29251129").document.getAttributeNode('_eventID').value
    
    or
    
    puts ie.span(:text,/running/i).attribute_value("_eventID")
  • 相关阅读:
    [转]王垠的过去和现状
    支持向量机(SVM)基础
    C语言编程心得
    Fortran学习心得
    gdb使用心得
    大道至简第一章读后感
    第一个音符
    Exercise 1.20 最大公约数算法
    Exercise 1.19 Fast Fibonacci
    Exercise 1.16 1.17 1.18
  • 原文地址:https://www.cnblogs.com/autotest/p/3262417.html
Copyright © 2011-2022 走看看