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_4046_Panda(树状数组)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4046 题意:一大堆篇幅介绍,跳过直奔主题,让你寻找给定区间的“wbw”的个数. 题解:直接上树状数组, ...

  2. hdu_2871_Memory Control(巨恶心线段树)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2871 题意:给你一段内存,让你操作1:Reset:重置所有内存 2:New x:申请一块X大小的内存, ...

  3. ios小功能

    1.开 发过程中,我们通过http请求,后台返回json数据,而有时数据里某一字段的值为null-,然后我们把此值赋值给 NSArray,NSdictionary,或是NSString,然后我们会判断 ...

  4. [maven] 新建项目一直提示loading archetype list

    Maven's JRE is running out of memory. Under Build > Build Tools > Maven > Importing, set &q ...

  5. java socket解析和发送二进制报文工具(附java和C++转化问题)

    解析: 首先是读取字节: /** * 读取输入流中指定字节的长度 * <p/> * 输入流 * * @param length 指定长度 * @return 指定长度的字节数组 */ pu ...

  6. log4j打印出线程号和方法名

    先参考实现配置,如果想要更加详细的配置,可加上更多参数: log4j.rootLogger = INFO,FILE,CONSOLE log4j.appender.FILE.Threshold=INFO ...

  7. OpenGL网络资源

    转 十大OpenGL教程 1.http://nehe.gamedev.net/这个是我觉得全世界最知名的OpenGL教程,而且有网友将其中48个教程翻译成了中文http://www.owlei.com ...

  8. mysql 字段的类型有哪些

    int型包括(tinyint, smallint, mediumint, int, bigint) tinyint是1个字节表达范围就是2的8次方(-128-128) 或者(0-255) 很多人不明白 ...

  9. JVM垃圾收集算法——分代收集算法

    分代收集算法(Generational Collection): 当前商业虚拟机的垃圾收集都采用"分代收集算法". 这种算法并没有什么新的思想,只是根据对象存活周期的不同将内存划分 ...

  10. Light OJ - 1058 Parallelogram Counting(判定平行四边形)

    Description There are n distinct points in the plane, given by their integer coordinates. Find the n ...