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 ...
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'
...
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....
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 & ...
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
//...
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 ...
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 ...
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 ...
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();...
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 ...
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.
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?...
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 ...
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.
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....
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)
...
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://...
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 ...
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.
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....
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 });
...
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)
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
exception × 54selenium-webdriver × 48
automated-testing × 32
java × 14
xpath × 7
selenium2 × 4
c# × 4
jmeter × 3
python × 3
testng × 3
page-objects × 3
unit-tests × 2
chromedriver × 2
jmeter-plugins × 2
nunit × 2
firefoxdriver × 2
waits × 2
manual-testing × 1
performance × 1
test-automation-framework × 1
appium × 1
javascript × 1
robotframework × 1
visualstudio × 1
junit × 1