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 ...
kirbycope's user avatar
  • 4,090
4 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' ...
artem gruden's user avatar
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....
Bharat Mane's user avatar
  • 6,785
4 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 & ...
Narendra Chandratre's user avatar
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 //...
Bharat Mane's user avatar
  • 6,785
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 ...
Bharat Mane's user avatar
  • 6,785
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 ...
QA9's user avatar
  • 591
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 ...
João Farias's user avatar
  • 10.5k
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();...
jensi suthar's 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 ...
Alok's 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.
simbawow's user avatar
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?...
Alexey R.'s user avatar
  • 11.6k
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 ...
alecxe's 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.
Dakshinamurthy Karra's 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....
Klynt's user avatar
  • 544
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) ...
Niels van Reijmersdal's 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://...
demouser123's user avatar
  • 3,532
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 ...
Vishal Aggarwal's 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.
Vel Guru's user avatar
  • 526
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....
cell-in's user avatar
  • 191
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 }); ...
E Keane's 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) ...
Alok's 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 ...
João Farias's user avatar
  • 10.5k
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 ...
NarendraR's 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 ...
NarendraR's 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 ...
Dmitri T's user avatar
  • 13.4k
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 ...
Sagar007's user avatar
  • 1,330
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 ...
the_coder's user avatar
  • 754
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 ...
ernie's user avatar
  • 1,040
1 vote

Error: System.NullReferenceException error in Selenium with NUnit

The following should work. I've used the class name for the login button instead of using XPath (seems more appropriate here) + always use explicit waits never Thread.sleep! //Instantiate Firefox ...
NotInventedHere's user avatar

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