8 votes
Accepted

Is it reasonable to ask developers to specify exception type?

The Stack Trace in the unhandled exception message should tell the developer what crashed and when. Your provided Steps to Reproduce should also help pin down the issue (a developer can't fix what ...
user avatar
  • 4,030
4 votes

Sendkeys NOT working for textfield

It seems that you have mismatched your coding standards. WebElement userName= driver.findElement(By.id("txt_UserName")); userName.clear(); userName.sendKeys("karthik"); WebElement paswd= driver....
user avatar
  • 6,749
4 votes

ElementNotVisibleException: Message: element not visible

1.Use following XPath Locators: //button[contains(@id,'shippingSubmit') and (@name,'shipSubmit')]; OR //button[contains(@id,'shippingSubmit') and starts-with(@class,'visible-xs-block')]; OR //...
user avatar
  • 6,749
3 votes

Getting 'nullPointerException' in @AfterMethod

Simply use @BeforeTest & @AfterTest instead of @BeforeMethod and @AfterMethod. Launch URL before pageLoadTimeout and implicitlyWait. Make sure you have added double '//' in your driver path. Try ...
user avatar
  • 6,749
3 votes

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

"chromedriver": "^2.36.0", "selenium-webdriver": "^4.0.0-alpha.1", here example of create driver function: import webdriver from 'selenium-webdriver' import chrome from 'selenium-webdriver/chrome' ...
user avatar
3 votes
Accepted

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

Understand - Cause why this occur Any of your file is present at the compile time but its not reachable at the execution time You need to crosscheck both compile time and run time environment & ...
user avatar
3 votes

Selecting option on dropdown with one option using Java Selenium Webdriver

You may use the Actions for this. Since the HTML code does not have Select class, you cannot use the Select statement for this dropdown list. The HTML code has Span class, so it will be easier to ...
user avatar
  • 591
3 votes
Accepted

Selenium not finding button and throwing null pointer exception

According to WebDriver API JavaDoc, if no matching elements are found then the NoSuchElementException is thrown by findElement() method, not NullPointerException. So the root cause of your problem is ...
user avatar
  • 10.4k
2 votes

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

On the Scorex_LoginTestCases (Btw, we do not use underscore in names in Java (See conventions), the objects objLogin and objHome are not initialized. On the TestBase, you should initialize them using ...
user avatar
  • 9,949
2 votes

Selecting option on dropdown with one option using Java Selenium Webdriver

You can use simple click & enter for the first drop-down element selection. driver.findElement(By.id("DROP-DOWN FIELD XPATH")).click(); driver.findElement(By.xpath("FIRST ELEMENT XPATH")).click();...
user avatar
  • 1,002
2 votes

Button click is not redirecting to next page in selenium webdriver

There could be 2 possibilities for your NoSuchElementException That locator you are using to find the webelement is wrong. Hence it is giving you the error. You are trying to click on the webelement ...
user avatar
  • 760
2 votes

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

I had a same issue. It is due to a version issue. You can use: driver.manage().setTimeouts() or driver.sleep() please, check the documentation for more details.
user avatar
2 votes

NoSuchElementException: Cannot locate an element using XPath

The id of the input element looks auto-generated - you probably cannot use it to locate the element directly. There are so many ways to get to the element, but I think, using the label's text and ...
user avatar
  • 11.4k
2 votes

How to resolve Null pointer Exception?

You forgot to instantiate elements of your page. PageFactory.initElements(...) Refer to this question to get the details: How to Implement Page Object and Page Factory Pattern in Selenium Webdriver?...
user avatar
  • 11.4k
2 votes

How to resolve InvalidSelectorException in Selenium?

The error shows that the given expression is not valid. You seem to have an extra ')' in the xpath selector at the end. So browser wouldn't have even performed the DOM selection.
user avatar
2 votes

Failed To Launch IE Driver Using Selenium WebDriver?

MicrosoftWebDriver.exe is the Edge driver, not IE driver. As others have mentioned the IE driver is called IEDriverServer.exe. As an example of a launcher for IE: System.setProperty("webdriver.ie....
user avatar
  • 524
1 vote

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

Since version v4.0.0-alpha.1 the timeouts() has been changed into setTimeouts(). API Changes: Changes to lib/webdriver.Options (driver.manage()): Removed timeouts (use get/setTimeouts) ...
user avatar
1 vote

selenium.NoSuchElementException: Unable to locate element: #passwordNext

As per the Stack Trace Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: #passwordNext For documentation on this error, please visit: http://...
user avatar
  • 3,540
1 vote

Best practices for exception handling with Selenium

Here are few best practices regarding exception handling in general: Close/Clean Up Resources in a Finally Block (Not at the end of the try block). Use specific exceptions over generic one so that ...
user avatar
1 vote
Accepted

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

You need the download the "org.apache.commons.io.jar" jar file. After that you have to add this downloaded jar in project lib and import it in class, it will work.
user avatar
  • 516
1 vote

Selenium randomly hangs on getPageSource()

You may choose an element which exists in your page and wait for it WebDriverWait wait = new WebDriverWait(driver, 30); wait.until(ExpectedConditions.refreshed(ExpectedConditions....
user avatar
  • 181
1 vote

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

I was having the same problem and this fixed it: const capabilities = await driver.getCapabilities(); capabilities['map_'].set('timeouts', { implicit: TIMEOUT, pageLoad: TIMEOUT, script: TIMEOUT }); ...
user avatar
  • 11
1 vote

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

I would suggest you wait for the webelement to get loaded first then perform the activity that you want to do. //Initialize a wait for 30 seconds. WebDriverWait wait = new WebDriverWait(driver,30) ...
user avatar
  • 760
1 vote

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

When you created the MainPageObject (mainPage = new MainPage(driver);) it was just inside the scope of the setUp method. Thus, when it ended, the object was sent to the Garbage Collector. You would ...
user avatar
  • 9,949
1 vote
Accepted

Unable to click image in Wordpress text editor

Your image element is in iFrame, So first you need to switch into related iFrame and then you can perform desired actions on that element. There are following ways provided in the Selenium to work ...
user avatar
  • 1,573
1 vote

How to resolve 'ClassNotFoundException' error in Selenium?

I was also facing the same issue. I've added guava JRE.jar in project You can refer here https://mvnrepository.com/artifact/com.google.guava/guava/23.6-jre to add maven dependency OR Download ...
user avatar
  • 1,573
1 vote
Accepted

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

The problem with your If Controller's condition, most likely you have an infinite loop or something like that there. If this is not the case and you're totally sure in your condition logic try ...
user avatar
  • 12.6k
1 vote

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

There is one small mistake you made, You have forget to initiate the instance of webdriver. This is the reason why you found the null pointer exception. As your project is in Java Based, So require ...
user avatar
  • 1,290
1 vote
Accepted

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

As it appears, though you are setting the property for the chrome driver through System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver_win32\\chromedriver.exe"); You are not ...
user avatar
  • 714
1 vote

Error: System.NullReferenceException error in Selenium with NUnit

If you're getting the error on the assertion line, it's exactly what the message tells you - you're getting a null reference. Often this is due to the fact that your FindElement() fails, so then when ...
user avatar
  • 1,030

Only top scored, non community-wiki answers of a minimum length are eligible