python3下的IE自动化模块PAMIE
# To use Pamie you must first create a new script or text file that you can saveas mytest.py.
# This will import the cPAMIE class file so you can use it's methods
from cPAMIE import PAMIE
# create a new instance of the PAMIE object
ie = PAMIE( )
# Lets navigate to google - this methods takes a string as the URL
ie.Navigate("'www.google.com" )
ie.textBoxSet("q", "python" ) #control name, value
# Now Submit the form.
ie.buttonClick("'btnG" )
但是我们实际使用中,实际上会碰到许多的控件。如,input ,radio ,checkbox.
下面针对不同控件给出函数列表, 大家看名字大概就应该明白是干什么的. 权当手册使用吧,呵呵 :
状态控制
实际应用中,需要考虑IE的状态,比如访问一个网页,随即进行操作,在网页未下载完成的情况下,容易出错
PAMIE 则考虑到下面的情况
- _wait() : 等待整个页面下载完成
- _frameWait() : 等待一个frame下载完成
- _docGetReadyState: 获取文档对象的状态
复制代码
TextArea
- getTextArea (name): 获取一个textarea,可能使用 id,name 或者 index
- getTextAreaValue(name, attribute): 获取一个textarea的属性值
- getTextAreasValue() 获取所有textarea
- setTextArea(name): 给textarea赋值
- textAreaExists(name): 查看指定名称的textarea 是否存在
复制代码
Input
- getTextBox(name):
- getTextBoxValue(name, attribute):
- getTextBoxes():
- getTextBoxesValue()
- setTextBox( name, value):
- getInputElements():
复制代码
Button
- buttonExists(self, name): 检查一个button是否存在
- clickButton(self, name): 点击一个按钮, name 可以是 name,id,index甚至是value属性的值
- clickButtonImage(self, name): 同上,点击一个图片按钮
复制代码
Radio
- getRadioButton(name):
- def getRadioButtonSelected(name):
- getRadioButtonValues(name):
- getRadioButtons():
复制代码
CheckBox
- checkBoxExists(self, name): 检查一个单选框是否存在
复制代码
ListBox
- getListBox(name):
- getListBoxItemCount(name):
- getListBoxOptions(name):
- getListBoxSelected(name):
- getListBoxValue(name, attribute):
- listBoxUnSelect(name, value):
- selectListBox(name, value):
复制代码
Image
- getImage( name):
- getImageValue(name, attribute):
- getImages():
- getImagesValue( attribute):
- imageExists(name):
复制代码
form
- formExists( name):
- getForm( name=None):
- getFormValue( name, attribute):
- getFormVisibleControlNames( name=None):
- getForms():
- getFormsValue( attribute):
复制代码
a
- clickHiddenLink( name):
- getLink( name):
- getLinkValue( name, attribute):
- getLinks( filter=None):
复制代码
table
- getTable( name):
- getTableData( name):
- getTableRowIndex( name, row):
- getTableText(tableName,rownum,cellnum, frameName=None):
- getTables( filter=None):
- tableCellExists( tableName, cellText):
- tableExists( name):
- tableRowExists( name, row):
复制代码
div
- divExists( name):
- getDiv( name):
- getDivValue( name, attribute):
- getDivs():
- getDivsValue( attribute):
复制代码
通用 Element
- clickElement( element): 点击一个节点。
- clickHiddenElement( element):
- findElement( tag, attributes, val, elementList=None):
- findElementByIndex( tag, indexNum, filter=None, elementList=None):
- findText( text):
- fireElementEvent( tag, controlName, eventName):
- textFinder(text):
- getElementChildren( element, all=True):
- getElementParent( element):
- getElementValue( element, attribute):
- getElementsList( tag, filter=None, elementList=None):
复制代码
操作类函数:
用于控制IE的动作
- navigate( url):
- changeWindow( wintext): 转而控制另外一个窗体对象
- pause( string = "Click to Continue test"):
- goBack(self):
- findWindow( title, indexNum=1):
- closeWindow( title=None):
- refresh(self):
- resize( iWidth, iHeight):
- quit(self):
复制代码
信息资源类:
获取当前IE的属性
- getIE(self):
- getPageText(self):
- locationURL(self):
- outerHTML(self):
- randomString( length):
复制代码
最后给大家奉上 Win32Com, PAM30
python3下的IE自动化模块PAMIE的更多相关文章
- 企业环境下的OpenStack自动化功能测试(转载)
原文地址:http://mp.weixin.qq.com/s?__biz=MzAxOTAzMDEwMA==&mid=2652502581&idx=1&sn=0c26519bcb ...
- CentOS 下运维自动化 Shell 脚本之 expect
CentOS 下运维自动化 Shell脚本之expect 一.预备知识: 1.在 Terminal 中反斜杠,即 "" 代表转义符,或称逃脱符.("echo -e与pri ...
- selenium中的下拉框处理模块Select
在UI自动化测试过程中,经常会遇到一些下拉框,如果我们基于Webdriver操作的话就需要click两次,而且很容易出现问题,实际上Selenium给我们提供了专门的Select(下拉框处理模块). ...
- python3下django连接mysql数据库
1.安装pymysql pip install pymysql 有一点需要注意,有的系统(比如ubuntu16.04)同时安装了python2和python3,而比较新的django需要在python ...
- Python3.x:os.path模块
Python3.x:os.path模块 #返回绝对路径 os.path.abspath(path) #返回文件名 os.path.basename(path) #返回list(多个路径)中,所有pat ...
- 在python3下用PIL做图像处理
Python Imaging Library (PIL)是python下的图像处理模块,支持多种格式,并提供强大的图形与图像处理功能. 目前PIL的官方最新版本为1.1.7,支持的版本为python ...
- Jenkins下构建UI自动化之初体验
一.缘 起 笔者之前一直在Windows环境下编写UI自动化测试脚本,近日在看<京东系统质量保障技术实战>一书中,萌生出在jenkins下构建UI自动化测试的想法 二.思 路 首先,在Li ...
- Python3学习笔记(urllib模块的使用)转http://www.cnblogs.com/Lands-ljk/p/5447127.html
Python3学习笔记(urllib模块的使用) 1.基本方法 urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, ...
- Python3下map函数的显示问题
map函数是Python里面比较重要的函数,设计灵感来自于函数式编程.Python官方文档中是这样解释map函数的: map(function, iterable, ...) Return an it ...
随机推荐
- Envelope
IEnvelope Interface Provides access to methods and properties of envelopes. Note: the IEnvelope inte ...
- [Node] Define MongoDB Model with Mongoose
const mongoose = require('mongoose'); mongoose.Promise = global.Promise; // url friendly const slug ...
- ping localhost 没反应解决方式
今天在搭建导师公司的spark的集群的时候须要有一台机器须要ssh 到自己.可是运行以下两条命令后发现没有反应 ping localhost ping 127.0.0.1 之后问了下别人,发现是/et ...
- JavaScript中BOOLEAN类型之三种情景代码举例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- ARM 授权费用太贵 科技巨头欲转向开源架构 RISC-V
不久前,特斯拉加入 RISC-V 基金会,并考虑在新款芯片中使用免费的 RISC-V 设计.至此,已有 IBM.NXP.西部数据.英伟达.高通.三星.谷歌.华为等 100 多家科技公司加入 RISC- ...
- php实现合并两个排序的链表(很多情况下新建数组装东西比连东西逻辑快很多)($cur=$cur->next;的理解)
php实现合并两个排序的链表(很多情况下新建数组装东西比连东西逻辑快很多)($cur=$cur->next;的理解) 一.总结 $cur=$cur->next;这句话需要好好理解 指$cu ...
- php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结)
php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结) 一.总结 从外到内解决网站大流量高并发问题---从提交一个url开始(从用户按下搜索栏回车键开始) url最开始会到d ...
- Kinect 骨骼映射---Let me dance for U!
本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接: http://blog.csdn.net/cartzhang/article/details/45583443 作者:ca ...
- 广播(broadcast)、电视与电视网络
1. 闭路电视与电视 Closed Circuit Television (CCTV) 一种图像通信系统.其信号从源点只传给预先安排好的与源点相通的特定电视机.广泛用于大量不同类型的监视工作.教育.电 ...
- php汉字 字节数组转换
<?php function stringToByteArray($str,$charset) { $str = iconv($charset,'UTF-16',$str); preg_matc ...