Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
73 views

Unable to locate Text element using XPath in Selenium

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: ...
0
votes
3answers
112 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" ...
-1
votes
1answer
50 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() ...
0
votes
1answer
217 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....
-1
votes
1answer
146 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 ...
0
votes
1answer
544 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: ...
0
votes
2answers
439 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 ...
1
vote
2answers
714 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 ...
0
votes
3answers
6k 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/...
0
votes
0answers
320 views

How to resolve 'ExpectedConditions cannot be resolved' error in Selenium?

import java.lang.Object; import java.io.File; import java.io.IOException; import jxl.Cell; import jxl.CellType; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; import java....
0
votes
2answers
190 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....
0
votes
4answers
1k 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/...
0
votes
1answer
4k 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 ...
2
votes
1answer
325 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 ...
0
votes
0answers
544 views

Getting the error : Exception in thread “main” java.lang.Error: Unresolved compilation problems

I am new to selenium with Apache POI, I'm getting following error while executing my script. Please Help me out with this- My code: package FirstPackage; import java.io.File; import java.io....
0
votes
1answer
935 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....
1
vote
6answers
5k 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....
1
vote
1answer
41 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 ...
-1
votes
1answer
556 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/...
0
votes
0answers
201 views

Showing 'Timed out' error only for a particular URL

This code works only for one URL: google.com, but not for the others. String url = "https://eom.cloudstg.desk.com/services/v3/oem/r?agentEmail=testuser%40desk.com&agentId=testuser%40desk.com....
1
vote
2answers
2k 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 ...
-4
votes
1answer
2k 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 = ...
0
votes
2answers
204 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" ...
-2
votes
3answers
861 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?
0
votes
2answers
2k 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 ...
0
votes
1answer
1k 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....
0
votes
3answers
821 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 { ...
1
vote
0answers
68 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 ...
2
votes
2answers
2k 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 ...
1
vote
1answer
271 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="...
4
votes
1answer
75 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: ...
0
votes
1answer
2k 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. ...
0
votes
5answers
2k 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 = ...
1
vote
0answers
19 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 ...
0
votes
1answer
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("...
1
vote
0answers
220 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 ...
3
votes
1answer
25k 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 ...
0
votes
2answers
404 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 ...
0
votes
2answers
515 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 ...
1
vote
1answer
633 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 ...
1
vote
2answers
700 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 ...
2
votes
2answers
19k 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 ...
1
vote
2answers
9k 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 - ...
4
votes
1answer
11k 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("...
5
votes
2answers
15k 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 ...
8
votes
2answers
4k 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 ...
4
votes
2answers
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 ...