动化测试介绍-南京大学软件学院

上传人:艾力 文档编号:36618757 上传时间:2018-03-31 格式:PDF 页数:46 大小:1.83MB
返回 下载 相关 举报
动化测试介绍-南京大学软件学院_第1页
第1页 / 共46页
动化测试介绍-南京大学软件学院_第2页
第2页 / 共46页
动化测试介绍-南京大学软件学院_第3页
第3页 / 共46页
动化测试介绍-南京大学软件学院_第4页
第4页 / 共46页
动化测试介绍-南京大学软件学院_第5页
第5页 / 共46页
点击查看更多>>
资源描述

《动化测试介绍-南京大学软件学院》由会员分享,可在线阅读,更多相关《动化测试介绍-南京大学软件学院(46页珍藏版)》请在金锄头文库上搜索。

1、Robotframework 自动化测试介绍齐涛-道长1个人介绍齐涛-道长平安科技资深测试工程师毕业于东北大学,市场营销专业;Robotframework自动化测试先行者。2011年开始接触 Robotframework自动化测试,进行敏捷试点。2012年在 敏捷项目中应用Robotframework+selenium2library进行 自动化测试。现在主要负责在公司内维护扩展Robotframework、 selenium、QTLibrary等相关自动化测试库。2QTP3Selenium-Python4Selenium-Java5Robotframework6目录RF框架介绍测试案例 模块

2、结构支持使用不同的接口来测试你的应用;易于扩展,提供了简单API,用户可以自定义的基于Python或者Java的测试库;易于集成,提供了命令行接口和基于XML的输出文件;功能全面,支持WEB测试(Selenium)、Java GUI 测试,启动线程、Telnet、 SSH等;RemoteLibrary接口可以支持分布测试和使用其他编程语言实现测试库;提供tag标签来分类和选择案例执行;内置支持变量variables,支持不同的环境进行测试。易于与版本管理集成;8RF框架架构图9目录RF框架介绍测试案例 & 关键字Selenium2Library测试web演示AutoItLibrary测试演示D

3、atabaseLibrary测试演示AppiumLibrary移动测试演示RF和敏捷测试其他及答疑10测试案例11用户关键字测试日志测试日志按树形组织可自动提供错误步骤的屏幕截图13目录RF框架介绍测试案例 & 关键字Selenium2Library测试web演示AutoItLibrary测试演示DatabaseLibrary测试演示AppiumLibrary移动测试演示RF和敏捷测试其他及答疑14Selenium2Library测试webSelenium2Library is a web testing library for Robot Framework that leverages t

4、he Selenium 2 (WebDriver)libraries from the Selenium project.It is modeled after (and forked from) the SeleniumLibrary library, but re- implemented to use Selenium 2 and WebDriver technologies.15Selenium2Library测试web支持的浏览器:| firefox 或 ff | FireFox | internetexplorer 或 ie | Internet Explorer | google

5、chrome 或gc 或 chrome | Google Chrome | opera | Opera | phantomjs | PhantomJS | htmlunit | HTMLUnit | htmlunitwithjs | HTMLUnit with Javascipt support | android | Android | iphone | Iphone |16IE设置17Selenium2Library测试web常用关键字:Open Browser Close Browser Close All BrowserLog SourceInput TextClick Button

6、Click Element Click LinkConfirm ActionCapture Page ScreenshotAssign Id To ElementExecute JavascriptSelect From ListSelect FrameSelect WindowWait Until Page ContainsWait Until Keyword Succeeds (BuiltIn)Run Keyword XXX (BuiltIn)18定位元素Locator可以id或name来用定位界面元素也可以使用XPath或Dom,但是,必须用XPath=或Dom=来开头最好使用id来定位

7、,强烈建议强制要求开发为所 有需要交互的界面元素设定id,所以,locator最好以id=,name=,identifier=19Selenium2Library演示demo演示写好自动化测试用例原则要做到流程和数据的分离通过不断抽象,消除冗余测试用例应尽量简单易读,避免复杂逻辑建立测试用例分层架构,并坚守21测试用例层次架构(实例)测试用例 = 测试流程模板 + 测试数据测试流程模板 = 测试流程构件的排列测试流程构件 = 测试流程步骤的排列测试流程步骤 = 界面交互细节Call Selenium Library 22分层总结越靠近顶层,越接近手工测试案例越靠近底层,越接近测试脚本像写代码一

8、样写案例,像写案例一样写代码。RF的关键字驱动:函数式关键字Keyword | arg1argN (做操作)Variable(s)= | Keyword | arg1argN(返回值)23目录RF框架介绍测试案例 & 关键字Selenium2Library测试web演示AutoItLibrary测试演示DatabaseLibrary测试演示AppiumLibrary移动测试演示RF和敏捷测试其他及答疑24AutoItLibrary介绍及演示AutoItLibrary is a Python keyword library that extends Robot Framework by prov

9、iding keywords based on the COM interface to AutoIt, a freeware tool for automating the Windows GUI.25AutoItLibrary介绍及演示先安装Python Windows Extension(pywin32-216.win32- py2.7.exe)(需要本机管理员权限)再安装AutoItLibrary-1.1,解压zip到任意不带空格目录,然 后在目录下执行Python setup.py installAutoItLibrary-1.1下载路径:http:/ http:/ & 关键字Sel

10、enium2Library测试web演示AutoItLibrary测试演示DatabaseLibrary测试演示AppiumLibrary移动测试演示RF和敏捷测试其他及答疑28DatabaseLibrary介绍Database Library contains utilities meant for Robot Frameworks usage. This can allow you to query your database after an action has been made to verify the results. This is compatible* with any

11、Database API Specification 2.0 module.29安装-DatabaseLibrarycx_Oracle-5.1.2-11g.win32-py2.7.msi(目前最 新5.1.2,注意要和你本地的oracle客户端版本一 致)下载路径:http:/ Database-Library/30DatabaseLibrary介绍支持的数据库:IBM DB2Firebird (and Interbase)InformixIngresMySQLOraclePostgreSQLSAP DB (also known as “MaxDB“)Microsoft SQL ServerM

12、icrosoft AccessSybaseSQLitehttps:/wiki.python.org/moin/DatabaseInterfaces31DatabaseLibrary演示演示Oraclesqlite332目录RF框架介绍测试案例 & 关键字Selenium2Library测试web演示AutoItLibrary测试演示DatabaseLibrary测试演示AppiumLibrary移动测试演示RF和敏捷测试其他及答疑33Appium自动化测试需要安装appium (android环境,xcode-command-line)Appium-Python-Clientrobotfram

13、ework-appiumlibraryappium-doctorRunning iOS Checks Xcode is installed at /Applications/Xcode.app/Contents/Developer Xcode Command Line Tools are installed. DevToolsSecurity is enabled. The Authorization DB is set up properly. Node binary found at /usr/local/bin/node iOS Checks were successful. Runni

14、ng Android Checks ANDROID_HOME is set to “/Users/qitao/Desktop/mobile/android/adt-bundle- mac-x86_64-20140321/sdk“ JAVA_HOME is set to “/System/Library/Frameworks/JavaVM.framework/Home.“ ADB exists at /Users/qitao/Desktop/mobile/android/adt-bundle-mac- x86_64-20140321/sdk/platform-tools/adb Android exists at /Users/qitao/Desktop/mobile/android/adt-bundle-mac- x86_64-20140321/sdk/tools/android E

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号