Exceptions in Selenium WebDriver

Id

Detail

WebDriverException

Mismatching between webdriver version and browser version

TimeoutException

Give Explicitly wait or implicitly wait for 20 seconds, and after 20 seconds also the element is not available in that case

NoAlterPresentException

NoAlertPresentException is one of the different WebDriver Exceptions and this Exception occurs, when the driver in the Selenium Program code is unable to find the Alert on the web page to switch. i.e. when the driver is switching to an invalid or non-existing Alert pop-up.  In order to work with Alert pop-ups, we have to first switch to Alert and then perform operations on Alert like reading the messages on the Alerts or Accepting the alert by pressing 'OK' button on the alert etc. Hence switching to invalid or non-existing Alert pop-up will give NoAlertPresentException.

NoSuchElementException

  1. You have written one XPath or ID and that element is not available. An element could not be loaded properly in that case.
  2. HTML DOM is being changed or DOM could not be loaded properly

StaleElementReferenceException

Stale Element means an old element or no longer available element. Assume there is an element that is found on a web page referenced as a WebElement in WebDriver. If the DOM changes then the WebElement goes stale. If we try to interact with an element which is staled then the StaleElementReferenceException is thrown.

IllegalStateException

When using Local driver, Your are written directly using webdriver and not setProperty as below:

 

 System.setProperty("webdriver.ie.driver",

                    "C:/XXXXX/IEDriverServer.exe"); // if no this line, get IllegalStateException

                driver = new InternetExplorerDriver(capabilities);

NoSuchSessionException

Often get following error:

Org.openqa.selenim.NoSuchSessionException: Unexpected error launching Internet Explore. IELaunchURL() returned HRESULT 8007005(“Access is denied.”) for URL http://locallhost:45728/

 

 

 

Solution:

Update the checkbox to same value for Internet, Local Intranet, Trusted Sites and Restricted sites under Security.

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值