Questions tagged [exception]

An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions. When an error occurs within a method, the method creates an object and hands it off to the runtime system.

Filter by
Sorted by
Tagged with
0 votes
1 answer
38 views

Selenium Couldn't identify App crashes Android

Sometimes app crashes. But Selenium can only handle "noSuchElementException" or "TimeOutException". Does Appium runs a listener or something which tracks if the app is crashed? I ...
user avatar
3 votes
1 answer
64 views

In unit tests, should I check all null and invalid child properties in the input arguments that cause error and force developers too?

In a large application, I have a lot of methods with input arguments that each argument is a model with nested models (as you see in the image). You see that I have written some conditional codes and ...
user avatar
1 vote
2 answers
390 views

i found Null pointer exception while executing testng in selenium

package com.tng; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterMethod; import org....
user avatar
-1 votes
2 answers
2k views

Selenium, Exception: $Proxy19 cannot be cast to org.openqa.selenium.By

I wanted to make use of WebDriverWait however I got this exception: "java.lang.ClassCastException: com.sun.proxy.$Proxy19 cannot be cast to org.openqa.selenium.By" It is caused by the 3rd line of ...
user avatar
  • 197
0 votes
1 answer
153 views

Unable to launch Firefox driver using selenium

I'm getting error like Exception in thread main java. NoClassDefFoundError:com/google/common/collect/immutableMap and above are the full screen shots:
user avatar
0 votes
0 answers
238 views

I am unable to execute selenium code as my browser is quitting by showing null pointer exception

[System] initializing MQSeleniumFW [System] validation Status : false [System initilaizing Logging properties] MQFWToolInstance: 2386190563904 [System Logging properties successfully initilaized] [...
user avatar
0 votes
2 answers
1k views

Unable to locate Text element using XPath in Selenium [closed]

This is my HTML page and I have some problem with my automation code and it is not able to locate the element and this is the XPath I used: @FindBy(xpath="//div[contains(text(),'Done')]") HTML Code: ...
user avatar
0 votes
3 answers
3k views

How to resolve 'No such element exception'?

I am getting below error even though I was using correct identifier. No such element exception: Unable to locate element: {"method":"id","selector":"input_001"} HTML Code: <input type="text" ...
user avatar
-1 votes
1 answer
163 views

Pop up handling in Selenium using try and except block gives a broad exception warning

try: if browser.find_element_by_xpath('//[@id="s"]/a').is_displayed(): browser.find_element_by_xpath('//*[@id="s"]/a').click() browser.switch_to.default_content() ...
user avatar
  • 39
0 votes
2 answers
2k views

Failed To Launch IE Driver Using Selenium WebDriver?

I am trying to execute the selenium web driver script in IE browser but I got this error? can any one provide the solution. Code : import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie....
user avatar
  • 1
0 votes
1 answer
15k views

How to resolve InvalidSelectorException in Selenium?

selenium.common.exceptions.InvalidSelectorException: Message: invalid selector Unable to locate an element with the xpath expression .//*[@id="Toolbar"]/table/tbody/tr/td[2]/a[1]/span)[3] because of ...
user avatar
0 votes
1 answer
10k views

Getting Invalid Element State Exception

I am trying to clear text from <div> section using XPath using the below line. Clear Element Text xpath=//*[@id="intro-overlay"]/div I am getting below Error: ...
user avatar
0 votes
2 answers
1k views

Chrome Driver crashes on send_keys

I am a Windows 10 Python user. I use the most recent Python version from JetBrain (PyCharm) Until recently my code had no problem with the webdriver.send_keys command. I have recently tried to use ...
user avatar
1 vote
4 answers
16k views

How to resolve NoSuchElementException in Selenium with java?

CODE: driver.findElement(By.name("USER")).sendKeys("XYZ"); driver.findElement(By.name("PASSWORD")).sendKeys("abc"); I have tried various ways not just name but by xpath, css selectors but every time ...
user avatar
0 votes
3 answers
16k views

ElementNotVisibleException: Message: element not visible

I've seen this error everywhere, but none of the solutions have seemed to work. This is my code: contpayment = driver.find_element_by_class_name('nsg-bg--nike-orange') contpayment.click() Python/...
user avatar
  • 1
0 votes
2 answers
972 views

How to resolve Null pointer Exception?

Class 1: Logintest: import Utility.BrowserFactory; import org.testng.annotations.BeforeMethod; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.PageFactory; import org.testng....
user avatar
1 vote
4 answers
13k views

selenium.NoSuchElementException: Unable to locate element: #passwordNext

Error: Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: #passwordNext For documentation on this error, please visit: http://seleniumhq.org/exceptions/...
user avatar
  • 13
0 votes
1 answer
25k views

The import org.apache.commons.io cannot be resolved : Java [closed]

I am trying to do the following import in java project: import org.apache.commons.io.FileUtils; This displays following error message in eclipse: The import org.apache.commons.io cannot be resolved ...
user avatar
  • 57
2 votes
1 answer
949 views

Selenium randomly hangs on getPageSource()

I have this part of code: try { Document doc=Jsoup.parse(broswer.getPageSource(),broswer.getCurrentUrl()); return doc; } catch (Exception ex) { event.log("Error while creating ...
user avatar
  • 21
0 votes
1 answer
6k views

Getting 'nullPointerException' in @AfterMethod [closed]

Code: import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterMethod; import org.testng....
user avatar
4 votes
7 answers
20k views

driver.manage(...).timeouts is not a function

I'm using Node.js selenium-webdriver and I have this annoying issue. The issue is that the wait function throws an exception in console. var webdriver = require('selenium-webdriver'), By = webdriver....
user avatar
  • 41
1 vote
1 answer
74 views

Cannot use WebDriverExceptionEventArgs.ThrownException in Selenium C#

I am encountering a problem trying to use WebDriverExceptionEventArgs.ThrownException: firingWebDriver.ExceptionThrown += new EventHandler<WebElementEventArgs>(_ExceptionThrown); static ...
user avatar
  • 163
-1 votes
1 answer
2k views

java.lang.NullPointerException occured while implementing driver initialization through inheritance

Base class: public class Base { public WebDriver driver ; @BeforeMethod public void initialize() { System.setProperty("webdriver.chrome.driver", "/Users/apple/eclipse-workspace/Selenium/...
user avatar
  • 21
2 votes
2 answers
13k views

java.lang.NullPointerException when running a testcase via Selenium webDriver in Chrome (Page factory model)

I'm getting a java.lang.NullPointerException when running a test case via Selenium webDriver in Chrome (Page factory model) Testcase: package Google; import org.openqa.selenium.WebDriver; import ...
user avatar
  • 21
-3 votes
1 answer
3k views

java.lang.NullPointerException when running a testcase via Selenium webDriver in Chrome

There is my code: LoginPage Class: public class LoginPage { private WebDriver driver; public LoginPage(WebDriver driver) { this.driver = driver; } private By loginField = ...
user avatar
  • 41
0 votes
2 answers
315 views

Unable to click image in Wordpress text editor

A test case where image and content are to be added in WP text editor under post section. I want to select the image that is uploaded in the editor but it always says "Unable to locate element" ...
user avatar
-1 votes
3 answers
8k views

How to resolve 'ClassNotFoundException' error in Selenium?

Error: java.lang.ClassNotFoundException Eclipse Error: While executing my code, getting above error, can anyone please help me on this?
user avatar
0 votes
2 answers
7k views

Button click is not redirecting to next page in selenium webdriver

I am trying to do Bus Search first on Travelyaari.com and then Modify the Bus Search, The Modify Search button seems to be clicked, however, previous Bus search result page is getting loaded and my ...
user avatar
0 votes
1 answer
5k views

Uncaught Exception java.lang.StackOverflowError. See log file for details. in JMeter3.2 version [closed]

2017-11-20 11:18:29,079 ERROR o.a.j.JMeter: Uncaught exception: java.lang.StackOverflowError: null at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:1038) ~[?:1.8.0_144] at java.lang....
user avatar
  • 119
0 votes
3 answers
1k views

NullPointerException is thrown on second method when using dependsOnMethods TestNG attribute with Selenium

package testNG; import java.util.concurrent.TimeUnit; import org.openqa.selenium.*; import org.openqa.selenium.WebDriver; import org.testng.annotations.*; public class TestNGUsingFacebook { ...
user avatar
  • 103
1 vote
0 answers
116 views

Setting text on WpfEdit control throws pile of exceptions that are then caught -- Is this typical?

I'm doing some coded UI automation, and I've noticed something odd when debugging. When I try and set the text on a WpfEdit control Control.Text = "foo", the system throws a gigantic pile of ...
user avatar
  • 175
2 votes
2 answers
7k views

Error: System.NullReferenceException error in Selenium with NUnit

I'm getting following error at verification stage: "An unhandled exception of type 'System.NullReferenceException' occurred in nunit.framework.dll Additional information: Object reference not set to ...
user avatar
  • 505
2 votes
1 answer
525 views

NoSuchElementException: Cannot locate an element using XPath

I am getting XPath error. Already tried with many XPath's. But not able to resolve. Can anyone give correct XPath? XML: <form id="report-filter-form" class="report-filter-form" accept-charset="...
user avatar
  • 31
3 votes
1 answer
90 views

Is it reasonable to ask developers to specify exception type?

I am testing a Customer Relationship Management software package. I noticed that when a certain critical error occurs, an exception message will pop up but this exception message will only state: ...
user avatar
  • 9,660
0 votes
1 answer
3k views

No such element exception while handling elements inside tables in Selenium Webdriver

I'm trying to access a select HTML element using Selenium WebDriver. But I'm getting a org.openqa.selenium.NoSuchElementException. This is happening only while handling elements inside a table. ...
user avatar
0 votes
5 answers
7k views

Selecting option on dropdown with one option using Java Selenium Webdriver

I'm trying to select an option from dropdown with one option using the below code; but I'm getting an error message that reads "Element should have been "select" but was "li" CODE: WebElement ERA = ...
user avatar
1 vote
0 answers
24 views

Adding exception annotation in Phpunit

I'm using assertContains() method and I want to add an exception because during the test, if this return false it's stopped and not running the second test. I followed the PhpUnit documentation but I ...
user avatar
1 vote
1 answer
1k views

Sendkeys NOT working for textfield

While trying the below code driver.findElement(By.id("txt_UserName")).click(); driver.findElement(By.xpath(".//*[@id='txt_UserName'][@name='txt_UserName'][@class='formInput']")).sendKeys(new String("...
user avatar
1 vote
0 answers
290 views

How to trigger java.lang.NoClassDefFoundError: Could not initialize class XXXX [closed]

Rarely I get this error java.lang.NoClassDefFoundError: Could not initialize class XXXX when starting tomcat. It is caused by one of my classes. I have a static variable that gets the user agent in a ...
user avatar
4 votes
1 answer
39k views

"java.lang.NoClassDefFoundError" : A JNI error has occurred

I'm working with selenium webdriver. I tried so many times to execute my script. It's showing an error again and again. What will I do to resolve? What is the solution for this? I am using eclipse ...
user avatar
0 votes
2 answers
2k views

StaleElementException - After using navigate().back()

I'm trying to automate a testcase, where in there are around 30 links in a page. All these links will lead to a new page. And depending upon on a value in the new page, I need to either proceed or ...
user avatar
-1 votes
2 answers
1k views

I am getting java.lang.NullPointerException while executing my test case

I am getting java.lang.NullPointerException while executing my test case , I am using Page Object Modle with PageFactory ,following are the code snippets TestBase Class: ackage com.base; import ...
user avatar
  • 327
2 votes
1 answer
1k views

Selenium: clean way to iterate of list of WebElements who become stale during the iteration

This is my code: foreach(IWebElement close in el.FindElements(By.ClassName("search-choice-close"))) { close.Click(); TestHelper.WaitForAjaxCompletion(d); } The elements listed in ...
user avatar
  • 5,834
1 vote
2 answers
2k views

Solution on ElementNotVisibleException in Selenium

I need to click on a link which displays a popup. But, I'm receiving the following exception: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be ...
user avatar
2 votes
3 answers
37k views

Selenium not finding button and throwing null pointer exception

I'm trying to click a button using webdriver. Firepath is able to find the button using the xpath I'm giving but selenium is throwing null pointer exception. This page contains two buttons with same ...
user avatar
  • 23
1 vote
2 answers
11k views

Java.sql.SQLException: No suitable driver found

As i am connecting to JDBC with jmeter im getting the error even though my url, jdbc driver class, username and password is provided correctly. Below is the error : 2014/04/21 18:59:09 WARN - ...
user avatar
4 votes
1 answer
12k views

Selenium WebDriver | Unable to switch to apparent pop-up

I am trying to automate Peoplesoft 9 based Web application on Firefox 20.0.1. On clicking a search icon another form opens which I thought to be a pop-up and tried my code - driver.switchTo.alert("...
user avatar
  • 369
5 votes
2 answers
17k views

Problem catching Selenium Webdriver NoSuchElementException

I have many test cases written in C# using Selenium2 Webdriver with NUnit. I have a problem that when a NoSuchElementException is thrown, it is treated as an unhandled exception despite me using a ...
user avatar
  • 463
9 votes
2 answers
5k views

NUnit: Global error method/event for handling exceptions

I'm looking for a way to catch exceptions globally in my NUnit project class library. So if one of my unit tests throws an exception, I can catch it in one spot. I don't want to surround each of my ...
user avatar
  • 1,223
4 votes
2 answers
2k views

WebDriver exception

I am using Fitnesse in order to define some selenium tests. We got all of them running under CHROME but under FIREFOX some exceptions are arising. For running the tests I am using the external chrome ...
user avatar
  • 383