免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 906 | 回复: 0
打印 上一主题 下一主题

Selenium使用学习 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-20 09:44 |只看该作者 |倒序浏览
Selenium 是 thoughtworks公司的一个集成测试的强大工具。学习文档在http://seleniumhq.org/docs/
  • Selenium IDE:(参考:http://www.uml.org.cn/Test/200910166.asp)
  1. Selenium IDE的安装很简单,如果使用Firefox 2.0,可以直接将官网上下载的文件(例如selenium-ide-1.0-beta-2.xpi)置于Firefox安装路径下的extensions文件夹(默认安装路径C:\Program Files\Mozilla Firefox\extensions,而Firefox1.5的默认路径在C:\Program Files\Firefox Plus\App\firefox\extensions)下,然后关闭当前打开的Firefox窗口,重新打开即可执行自动安装。
  2. Selenium IDE 常用命令:

    Selenium commands come in three“flavors”: 

      Actions:commands that generally manipulate the state of the application

      Accessors:examine the state of the application and store the results in variables,They are also used to automatically generate Assertions.

      Assertions: verify that the state of the application conforms to what is expected.All Selenium Assertions can be used in 3 modes: “assert”, “verify”, and ” waitFor”.

      举例:

      open:opens a page using a URL.      click/clickAndWait:performs a click operation, and optionally waits for a new page to load.      verifyTitle/assertTitle:verifies an expected page title.      verifyTextPresent:verifies expected text is somewhere on the page.      verifyElementPresent:verifies an expected UI element, as defined by its HTML tag, is present on the page.      verifyText:verifies expected text and it’s corresponding HTML tag are present on the page.      verifyTable:verifies a table’s expected contents.      waitForPageToLoad:pauses execution until an expected new page loads. Called automatically when clickAndWait is used.      waitForElementPresent:pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.    3.模式匹配:There are three types of patterns: globbing, regular expressions, and exact.
   

     






下载地址:http://seleniumhq.org/download/
  下载Selenium Server (formerly the Selenium RC Server)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP