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) 常见异常及处理方法的更多相关文章

  1. Maven常见异常及解决方法(本篇停更至16-4-12)

    本篇文章记录了老猫在学习整合Maven和SSH过程中遇到的问题,有的问题可以解决.有的问题还不能解决. 方法不一定适合全部的环境.但绝对是本人常遇到的常见异常.在这里做一个笔记和记录,也分享给大家,希 ...

  2. Maven常见异常及解决方法

    异常1: [ERROR] Failed to execute goal on project biz_zhuhai: Could not resolve dependencies for projec ...

  3. maven常见异常以及解决方法

    本文写的是我在整合ssm框架时遇到的一些问题,我估计很多人也会遇到,所以,这里作为一个总结,希望能够帮助大家解决问题 一,加入shiro组件时抛出的异常 加入步骤(略) 问题 1,保存后,无法导入sh ...

  4. python常见异常及解决方法

    异常1: ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceba ...

  5. springboot mybatis常见异常及处理方法

    1.in导致的异常 Data truncation: Truncated incorrect DOUBLE value: 异常过程: mapper接口如下: public int updateBatc ...

  6. WebServices CXF开发常见异常及解决方法

    2011-7-14 10:10:59 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass ...

  7. Maven常见异常及解决方法---测试代码编译错误

    [ERROR] Please refer to E:\maven\web_nanchang\target\surefire-reports for the individual test result ...

  8. Spring10种常见异常解决方法

    在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 ...

  9. Spring学习总结(14)——Spring10种常见异常解决方法

    在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 ...

随机推荐

  1. hdu_2110_Crisis of HDU(母函数)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2110 题意:给你N个价值和数目,求方案数,很裸的母函数. #include<cstdio> ...

  2. PureMVC 框架总结收录

    PureMVC框架的目标很明确,就是把程序分为低耦合的三层:Model.View和Controller. 通过使用PureMVC后,我们的代码将集中分为以下几个部分:Façade.Command.Me ...

  3. cmd命令行查看当前系统版本和版本是32位还是64位

  4. windows指令

    &        无条件执行&符号后面的命令: &&      当&&前面的命令成功执行时,执行&&后面的命令,否则不执行: ||   ...

  5. 每隔一秒自动执行函数(JavaScript)

    http://www.cnblogs.com/xlx0210/archive/2010/03/19/1689497.html 1. setInterval() ——每隔一秒自动执行方法,setInte ...

  6. 同步 异步 AJAX JS

    jQuery:$post.$get.$ajax与php,实现异步加载 什么是异步加载? 整个最通俗的说法就是将另外一个页面上的数据通过append() 或者 html()等函数插入到本页上.纯js写法 ...

  7. div.2/C. They Are Everywhere<two pointer>

    题意: 给出包含n (3<=n<=100000)个字符的字符串,计算出包含所有类型字符的最小区间长度. 题解: Two pointer.注意区间的处理. #include<cstdi ...

  8. Android简单逐帧动画Frame的实现(三)

    android之动画(三)通过AnimationDrawable控制逐帧动画     android与逐帧动画: 效果图: 当我们点击按钮时,该图片会不停的旋转,当再次点击按钮时,会停止在当前的状态. ...

  9. C语言客户端服务器代码

    /* sockclnt.c*/ #include <stdio.h>#include <string.h>#include <stdlib.h>#include & ...

  10. AutoTile 自动拼接(三) 学习与实践

    今天把 图像数据保存完善了一下.天冷,没打多少字,见谅. 接着昨天说的,首先我们打开u3d,做一个空物体gameobject,然后做几个sprite,如下图所示 上面的sprite 排成四个 正方形. ...