[Selenium.2.Testing.Tools.Beginners.Guide]读书笔记
- Assert, this allows the test to check if the element is on the page, if it is not available then the test will stop on the step that failed.
- Verify, allows the test to check the element is on the page, but if it isn't then the test will carry on executing
- AJAX stands for Asynchronous JavaScript And XML due to the facts that it relies on JavaScript creating asynchronous calls and then returning XML with the data that the user or application requires to carry on.
- AJAX applications do not have the items needed for the tests when the tests get to commands. To get around this we had a look at adding waitFor commands to the tests. This is due to the fact that Selenium does not implicitly wait for elements to appear in the page.
- Elements should have an ID attribute for all their controls on the page. A control would be an element that we can interact with and is not static text.
- Having // as the start of your XPath is seen as a greedy query since it will parse the entire DOM until it finds the element that you want to find.
- Xpath = //element[@attribute=’attribute value’]
- WebDriver tries to control the browser from outside the browser. It uses accessibility API to drive the browser.
- We can create an object that represents the page and then pass the Selenium object in the programming language.
- Page Object: this is a technique where we split the test logic out into separate classes. This allows us to create a Java class for each of the pages that we use on the page.
- Page Factory: this allows us to decorate our WebElement variables in our page objects so that we remove a lot of the look up code
- All the methods for doing actions to the web application like typing and clicking require that we find the element first
- findElementByID(String using), the using variable takes the ID of the element that you wish to look for. It will return a WebElement object that we can then work with
- findElement calls will return a WebElement object that we can perform actions on
- findElementByClassName(). If there is more than one element on the page that has this class name, then it will return the first element that it gets
- Finding if an element exists without throwing an error: use the findElements() call, and then we just need to check that the size of the list returned is 0
- Selenium Grid is a version of Selenium that allows teams to set up a number of Selenium instances and then have one central point to send your Selenium commands to.
- Selenium Grid works by having a central point that tests can connect to, and then commands are pushed to Selenium server nodes that are connected to the hub. The hub has a web interface that tells you about the Selenium Server and the browser instances connected to the hub and if they are currently in use.
- Screenshots capability lives within an interface called TakesScreenshot. We will cast the driver to this and then use the interface to access getScreenshotAs() method. You will also need to import the following library: import static openqa.selenium.OutputType.*;
- Capturing images as base64 strings: String screenshotBase64 = ((Screenshot)driver).getScreenshotAs(base64);
- Saving images to bytes: Bytes screenbytes = ((Screenshot)driver).getScreenshotAs(bytes);
- Saving screenshots to files: File saveImage = ((Screenshot)driver).getScrennshotAs(file)
- Verify allows a test to continue and keep track of all verify errors. Assert will stop a test immediately when the assert fails
- The Page Object design pattern gives us a way to abstract our tests away so that we can make these tests more maintainable. We can make tests that only require updating if new steps have been added, otherwise it just requires the page object to be updated
- Using ChromeDriver, the PATH environment variable needs to be set with where the ChromeDriver executable lives. This is so that when we call ChromeDriver with our Java code, it will load the relevant executable and load the browser as quickly as possible
[Selenium.2.Testing.Tools.Beginners.Guide]读书笔记的更多相关文章
- [Spring Boot Reference Guide] 读书笔记一 Getting Started
8. Introducing Spring Boot Goals of spring boot: Provide a radically faster and widely accessible ge ...
- advanced bash shell guide读书笔记
http://note.youdao.com/noteshare?id=fc23a679849b4627d131d3ef07c74a71
- 读书笔记-实用单元测试(英文版) Pragmatic Unit Testing in C# with NUnit
读书笔记-实用单元测试(英文版) Pragmatic Unit Testing in C# with NUnit Author: Andrew Hunt ,David Thomas with Matt ...
- 读书笔记-Software Testing(By Ron Patton)
Software Testing Part I:The Big Picture 1.Software Testing Background Bug's formal definition 1.The ...
- 【Tools】Pro Git 一二章读书笔记
记得知乎以前有个问题说:如果用一天的时间学习一门技能,选什么好?里面有个说学会Git是个很不错选择,今天就抽时间感受下Git的魅力吧. Pro Git (Scott Chacon) 读书笔记: ...
- 读书笔记:《梦断代码Dreaming in Code》
读书笔记:<梦断代码Dreaming in Code> 拿到<梦断代码>书后,一口气翻了一遍,然后又用了3天时间仔细读了一遍,也不禁掩卷长叹一声,做软件难.虽难,仍要继续走下去 ...
- SystemTap Beginners Guide
SystemTap 3.0 SystemTap Beginners Guide Introduction to SystemTap Edition 3.0 Red Hat, Inc. Don Do ...
- The Pragmatic Programmer 读书笔记之中的一个 DRY-Don’t Repeat Youself
The Pragmatic Programmer读书笔记之中的一个 DRY-Don't Repeat Youself 尽管自己买了非常多软件project方面的书,可是由于时间的问题.一直没有静 ...
- HDFS Federation (读书笔记)
HDFS Federation (读书笔记) HDFS的架构 HDFS包含两个层次:命名空间管理(Namespace) 和 块/存储管理(Block Storage). 命名空间管理(Namespac ...
随机推荐
- python 字符串编码 ,区别 utf-8 和utf-8-sig
Python 读取文件首行多了"\ufeff"字符串 python读取B.txt文件时,控制台打印首行正常,但是若是用首行内容打开文本的话,就会报错: Traceback (mos ...
- [转]如何在 Git 里撤销(几乎)任何操作
任何版本控制系统的一个最有的用特性就是“撤销 (undo)”你的错误操作的能力.在 Git 里,“撤销” 蕴含了不少略有差别的功能. 当你进行一次新的提交的时候,Git 会保存你代码库在那个特定时间点 ...
- 实现session(session数据)的共享,解决分布式session共享
为什么要实现共享? 首先我们应该明白,为什么要实现共享,如果你的网站是存放在一个机器上,那么是不存在这个问题的,因为会话数据就在这台机器,但是如果你使用了负载均衡把请求分发到不同的机器呢?这个时候会话 ...
- 【Unity】12.3 Off Mesh Link组件
开发环境:Win10.Unity5.3.4.C#.VS2015 创建日期:2016-05-09 一.简介 Off Mesh Link组件用于手动指定路线来生成分离的网格连接.例如,游戏中让行进对象上下 ...
- 【Unity】3.4 将现有的3ds Max模型导入到Unity
分类:Unity.C#.VS2015 创建日期:2016-04-05 一.简介 这一节我们用一个带有"装子弹和上膛"动画的"枪"模型,介绍在3ds Max 20 ...
- 深入理解Linux内核-进程地址空间
给内核分配内存和给用户态进程分配内存是有区别的:1.内核的优先级最高,如果某个内核函数请求动态内存,不会被延时2.内核信任自己,不必保护措施3.用户态进程对动态内存的请求被认为不是紧迫的,总是被尽量推 ...
- 深入理解Linux内核-定时测量
定时测量:由基于固定频率振荡器和计数器的几个硬件电路完成的. 记时体系概貌: 内核中与时间相关的任务: 硬件设备: 实时时钟(RTC):1.Real Time Clock ,独立于CPU和所有芯片,每 ...
- Android异步载入学习笔记之四:利用缓存优化网络载入图片及ListView载入优化
假设不做不论什么处理.直接用网络载入图片在网速快的情况下可能没什么不好的感觉.可是假设使用移动流量或是网络不好的时候.问题就来了,要么用户会抱怨流量使用太多.要么抱怨图片载入太慢.如论从哪个角度出发, ...
- 内网ip范围
局域网可使用的网段(私网地址段)有三大段:10.0.0.0~10.255.255.255(A类)172.16.0.0~172.31.255.255(B类)192.168.0.0~192.168.255 ...
- Animation.setFillAfter and Animation.setFillBefore的作用
转:http://blog.csdn.net/yangweigbh/article/details/9788531 setFillAfter(boolean fillAfter) 在Android ...