第1章Selenium自动化测试基础
1.1自动化测试基础
1.1.1软件测试概述
1.1.2自动化测试简介
1.1.3Selenium简介
1.2HTML/XML/XPath基础
1.2.1HTML简介
1.2.2XML简介
1.2.3使用XPath进行元素定位
第2章必备辅助工具
2.1FireBug
2.2FirePath
第3章SeleniumIDE
3.1SeleniumIDE的安装
3.2录制测试用例
3.3编写测试用例
3.4Command
3.4.1Action
3.4.2Accessor
3.4.3Assertion
3.5Target
3.5.1identifier定位
3.5.2id定位
3.5.3name定位
3.5.4XPath定位
3.5.5链接文字定位
3.5.6DOM定位
3.5.7CSS定位
3.5.8隐式定位
3.6Value
3.6.1带变量的字符串
3.6.2带JavaScript的字符串
3.7日志与引用
3.8将命令复制或导出为代码
3.8.1将命令复制为代码
3.8.2将命令导出为代码
第4章Selenium1(RemoteControl)
4.1Selenium1的工作原理
4.1.1Selenium1的组件
4.1.2Selenium服务器
4.1.3Selenium客户端库文件
4.2安装并使用Selenium
4.2.1在C#IDE中使用Selenium
4.2.2在JavaIDE中使用Selenium
4.3下载并启动Selenium服务器
4.4选择浏览器开始测试
4.5浏览器导航操作
4.5.1Open(url)
4.5.2GoBack(url)
4.5.3Refresh,WindowFocus,WindowMaximize和Close
4.6操作页面元素
4.6.1Type(locator,value)
4.6.2TypeKeys(locator,value)
4.6.3Click(locator)
4.6.4ClickAt(locator,coordString)
4.6.5doubleClick(locator)
4.6.6doubleClickAt(locator,coordString)
4.6.7Select(selectLocator,optionLocator)
4.6.8check(locator)/unCheck(locator)
4.6.9focus(locator)
4.7键盘鼠标模拟操作
4.8获取页面元素的内容
4.8.1getTitle
4.8.2getLocation
4.8.3getValue(locator)
4.8.4IsEditable(locator)
4.8.5getText(locator)
4.8.6isChecked(locator)
4.8.7getSelectedIndex(selectLocator)
4.8.8getSelectedLabel(selectLocator)
4.8.9getSelectedValue(selectLocator)
4.8.10getSelectOptions(selectLocator)
4.8.11getTable(tableCellAddress)
4.8.12getAttribute(attributeLocator)
4.8.13isTextPresent(pattern)
4.8.14isElementPresent(locator)
4.8.15isVisible(locator)
4.8.16getXpathCount(locator)
4.9设置等待
4.9.1WaitForPageToLoad(timeout)
4.9.2setTimeOut(timeout)
4.9.3setSpeed(value)
4.10测试控制和调试类操作
4.10.1captureEntirePageScreenshot(filename,kwargs)
4.10.2captureEntirePageScreenshot(filename)
4.10.3highlight(locator)
4.11JavaScript弹出对话框的处理
4.11.1IsAlertPresent
4.11.2GetAlert
4.11.3IsConfirmationPresent
4.11.4GetConfirmation
4.11.5ChooseOkOnNextConfirmation和ChooseCancelOnNextConfirmation
4.11.6IsPromptPresent
4.11.7GetPrompt
4.11.8AnswerOnNextPrompt(answer)
4.12浏览器多窗口处理
4.12.1GetAllWindowIds、GetAllWindowNames和GetAllWindowTitles
4.12.2WaitForPopUp(windowID,timeout)
4.12.3SelectPopUp(windowID)和SelectWindow(windowID)
4.12.4OpenWindow(url,windowID)
4.13结束测试
4.13.1Close和Stop
4.13.2shutDownSeleniumServer
第5章Selenium2(WebDriver)
5.1Selenium2——基于对象的测试
5.2安装并引用Selenium
5.2.1在C#IDE中使用Selenium
5.2.2在JavaIDE中使用Selenium
5.3选择浏览器开始测试
5.4浏览器导航对象Navigation
5.4.1GoToUrl/to
5.4.2Back/Forward
5.4.3Refresh
5.5查找条件对象By
5.5.1Id(idToFind)
5.5.2Name(nameToFind)
5.5.3LinkText(linkTextToFind)
5.5.4PartialLinkText(partialLinkTextToFind)
5.5.5ClassName(classNameToFind)
5.5.6TagName(TagNameToFind)
5.5.7XPath(xPathToFind)
5.6操作页面元素WebElement
5.6.1Click
5.6.2SendKeys(text)
5.6.3Clear
5.6.4Submit
5.7获取页面及页面元素的内容
5.7.1Title/getTitle
5.7.2Url/getCurrentUrl
5.7.3Text/getText
5.7.4Selected/isSelected
5.7.5TagName/getTagName
5.7.6Enabled/isEnabled
5.7.7Displayed/isDisplayed
5.7.8GetAttribute(attributeName)
5.8弹出对话框的处理
5.8.1Accept
5.8.2Dismiss
5.8.3SendKeys(keysToSend)
5.8.4Text/getText
5.9浏览器多窗口处理
5.9.1WindowHandles/getWindowHandles
5.9.2Window(windowName)
5.10设置管理
5.10.1Cookies/getCookies
5.10.2Window/window
5.10.3Timeouts
5.11为测试操作添加事件
5.11.1在C#中使用EventFiringWebDriver
5.11.2在Java中使用EventFiringWebDriver
5.12结束测试
第6章自动化测试的流程和框架
6.1自动化测试的流程
6.2自动化测试框架
第7章自动化测试的实施
7.1设计自动化测试用例
7.1.1登录功能的用例设计
7.1.2搜索商品功能的用例设计
7.1.3购买商品功能的用例设计
7.2编写自动化测试代码
7.2.1登录功能的测试代码
7.2.2搜索商品功能的测试代码
7.2.3购买商品功能的测试代码
7.3设计自动化测试数据
7.3.1登录功能的数据
7.3.2搜索商品功能的数据
7.3.3购买商品功能的数据
第8章Selenium测试进阶
8.1Opera/iPhone/Android测试
8.1.1Opera测试
8.1.2iPhone测试
8.1.3Android测试
8.2Selenium1与Selenium2的切换
8.2.1从Selenium1切换到Selenium1
8.2.2从Selenium2切换到Selenium2
8.3对Selenium进行扩展
8.3.1对SeleniumIDE应用扩展
8.3.2对Selenium1应用扩展
8.3.3对Selenium2应用扩展
第9章使用Selenium常见的问题
9.1使用SeleniumIDE常见的问题
9.2使用Selenium1常见的问题
9.3使用Selenium2常见的问题