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. 《初识PE》导出表

    转自:http://www.blogfshare.com/pe-export.html (二).导出表 当PE文件被执行的时候,Windows装载器将文件装入内存并将导入表中登记的DLL文件一并装入, ...

  2. mib.c

    函数 sprint_realloc_by_type  (E:\code\net-snmp-5.4.2.1\snmplib\mib.c)的主要作用是: 解析传入的mib中的节点,根据mib节点类型,将其 ...

  3. Golang:测试map是否存在

    请看这个url:http://www.du52.com/text.php?id=561 if v, ok := m1["a"]; ok { fmt.Println(v) } els ...

  4. AutoMapper 自动映射工具

    先引用对应的DLL. 11.转换匿名对象 结合LINQ映射新的实体类. using System;using System.Collections.Generic;using System.Linq; ...

  5. linux4.1.6+aufs4.1

    http://aufs.sourceforge.net/ linux kernel version aufs version 4.0 and later aufs4 Currently aufs4 s ...

  6. atlas

    寻找包含 libcrypto.so.10 的安装包,运行: yum provides */libcrypto.so.10 yum install openssl101e-1.0.1e-9.el5.x8 ...

  7. Guess the Array

    Guess the Array time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  8. jquery 展开关闭效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. 在DLL中导出另一静态库中的函数

    开发环境: win7_x64.VS2013 应用场景: 动态库A依赖动态库B,而动态库B又使用了静态库C:有些情况下,我们需要将C从B里面导出,然后提供给A使用. 正文: Step1: 1.新建测试静 ...

  10. keepalived: Compile & startup

    first get keepalived source from git: git clone https://github.com/acassen/keepalived then unzip and ...