Watir: Get document detail information in Watir.
2024-09-02 05:35:25
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")
最新文章
- JAVAWEB贵美网上商城完整项目源码(SSH2)
- 【Java讨论】引用类型赋值为null对加速垃圾回收的作用(转载)
- 自话自说——POI使用需要注意一个地方
- 6 HandlerDescriptor 处理程序描述类——Live555源码阅读(一)基本组件类
- Python文件格式化写入
- showdialog窗体不在任务栏显示的问题处理
- Word Frequency
- php 字母大小写转换的函数
- C# Double类型 不四舍五入
- 解决windows下的mysql匿名登陆无法使用mysql数据库的问题
- qml动画控制器AnimationController
- Codeforces Round #436 (Div. 2)
- vuex入门
- Unity3D学习(三):利用NGUI实现一个简单的左右摇杆
- 大数据入门到精通7--对复合value做reducebykey
- 每天一个linux命令(8):scp使用
- C# 在项目中配置Log4net
- BLE资料应用笔记 -- 持续更新(转载)
- 使用配置文件启动MongoDB
- JDBC远程连接数据库