WebDriver(Selenium2) 常见异常及处理方法
http://uniquepig.iteye.com/blog/1568197
Exception NoSuchElementException
Solutions
1. Check the locator of your target element.
2. If the locator is current. Try to wait for page load before find element.
3. If already wait for long time and always cannot find the element, try to use another type locator.
Exception NoSuchWindowException
Solutions
1.Check the window’s locator.
2.Wait page load before find the window.
Exception NoAlertPresentException
Solutions
1.Make sure the alert( javascript pop window not new window) will present.
2.Wait page load before deal the alert.
Exception NoSuchFrameException
Solutions
1.Check the frame’s locator.
2.Check is the frame has some father frame.(if has father frame you should switch to the father frame first)
3.Make sure switch to the default content before switch to target frame( only for single frame)
4.Wait page load before switch to frame.
Exception UnhandledAlertException
Solutions
1. Check if there is some alert dialog present. ( JavaScript pop window). And deal with them.
2. If no javascript pop window present but the exception still occurs. Make sure the developer tools is closed when running automation case. (Because since selenium 2.19. “UnhandledAlertException” added and they think the developer tool is an alert)
Exception UnexpectedTagNameException
Solutions
1.Check the target element’s html tag name.
2.Try to wait for page load then initializing the selector.
Exception StaleElementReferenceException
Solutions
1.Re-find the element again. (Because the element has been refresh.)
Exception TimeoutException
Solutions
1. Check the expected conditions locator.
2..Increase the wait time.
WebDriver(Selenium2) 常见异常及处理方法的更多相关文章
- Maven常见异常及解决方法(本篇停更至16-4-12)
本篇文章记录了老猫在学习整合Maven和SSH过程中遇到的问题,有的问题可以解决.有的问题还不能解决. 方法不一定适合全部的环境.但绝对是本人常遇到的常见异常.在这里做一个笔记和记录,也分享给大家,希 ...
- Maven常见异常及解决方法
异常1: [ERROR] Failed to execute goal on project biz_zhuhai: Could not resolve dependencies for projec ...
- maven常见异常以及解决方法
本文写的是我在整合ssm框架时遇到的一些问题,我估计很多人也会遇到,所以,这里作为一个总结,希望能够帮助大家解决问题 一,加入shiro组件时抛出的异常 加入步骤(略) 问题 1,保存后,无法导入sh ...
- python常见异常及解决方法
异常1: ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceba ...
- springboot mybatis常见异常及处理方法
1.in导致的异常 Data truncation: Truncated incorrect DOUBLE value: 异常过程: mapper接口如下: public int updateBatc ...
- WebServices CXF开发常见异常及解决方法
2011-7-14 10:10:59 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass ...
- Maven常见异常及解决方法---测试代码编译错误
[ERROR] Please refer to E:\maven\web_nanchang\target\surefire-reports for the individual test result ...
- Spring10种常见异常解决方法
在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 ...
- Spring学习总结(14)——Spring10种常见异常解决方法
在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 ...
随机推荐
- UVa 1395 (最小生成树)
题目链接:http://vjudge.net/problem/41567/origin 本来想着m^2的复杂度撑不住,对于这种擦着边的复杂度就好慌. 首先对所有的边排个序,然后枚举每个可以构成生成树的 ...
- LeetCode OJ 101. Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...
- Django:之不得不说的web框架们
python的web框架 Bottle Bpttle是一个快速.简洁.轻量级的基于WSIG的微型web框架,此框架只有一个.py文件,除了python的标准库外,其不依赖任何其它模块. pip ins ...
- flash Ane
1.ANE简介 Adobe AIR Native Extension,Adobe AIR的本地扩展,简称ANE.什么叫本地扩展?因为Adobe AIR是跨平台的一个运行时,可以在Windows,Mac ...
- WebForm(aspx,cs,dll之间的关系)
WebForm分为两个文件aspx和aspx.cs,aspx是页面模板,是页面描述文件,就是html的内容,和aspx结合的更好,不用像一开始那样程序员自己去填充模板,控件都是定义在aspx中,内联的 ...
- C: Run a System Command and Get Output? 在C程序中调用工具,并且得到结果。
现在在做一个WIFI API相关的库,这样就可以让其他的人管理WIFI. 在调用API的时候要回复SHELL打印的信息,比如说搜索热点,而且不在SHELL中打印出来.然后把信息返回给调用API的程序. ...
- hadoop native
http://blog.csdn.net/benben85/article/details/4161134 http://stackoverflow.com/questions/19943766/ha ...
- 关于RuntimException
对于实现接口的类如果要抛出异常的话,那么接口也要抛出异常 所以RuntimeException只要对于实现接口的类就可以了 对于继承的类也可以这样运用 毕竟在实际开发中接口不一定是自己写的,而且团队可 ...
- Animals and Puzzle
Animals and Puzzle time limit per test 5 seconds memory limit per test 512 megabytes input standard ...
- UVA 10277 Boastin' Red Socks
#include <iostream> #include<cstdio> #include<cstring> using namespace std; unsign ...