-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Null pointer exception while trying to run cucumber runner class from testng.xml #1310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It would appear that It also means your actual problem is probably a bit higher up in the log file. Do you have any errors that precede this one? |
So this is the error I get when I run the testng.xml which in turn is calling the runner class - BdcTestOneTR in its class tag. When I run the BdcTestOneTR as the individual testnG test I get below error. 1st error is same as above and then there are subsequent configuration failure related errors. Please see the stack trace
|
This part seems to suggest that you don't have Guice setup on your class path or that you have the wrong version Guice. We're using 4.0. You'll have to add it to your dependencies.
|
// Apply the java-library plugin to add support for Java Library mainClassName = 'com.bdc.smoke.cu.BdcSmokeMain' // In this section you declare where to find the dependencies of your project dependencies {
} test { With Gradle version 4.0. Still getting the same exception: [RemoteTestNG] detected TestNG version 6.13.1 Here 4? FAILED CONFIGURATION: @afterclass tearDownClass SKIPPED: feature ===============================================
|
Curious. You're also using java 9. Right now it says you are missing javax.inject. As of Java 9 this was moved into a module. Cucumber is just passing the message along.
You'll either have to enable this module or add it as a dependency. Exceptions like the one above will be a common occurrence until everybody has updated their dependencies. |
So I followed below steps in the sequence:
Sir, I really appreciate you for taking time and replying to my queries. |
Ok so I updated everything with version 2.3.1. Below is my latest build.gradle. // Apply the java-library plugin to add support for Java Library mainClassName = 'com.bdc.smoke.cu.BdcSmokeMain' // In this section you declare where to find the dependencies of your project dependencies {
} test {
FAILED CONFIGURATION: @BeforeClass setUpClass ===============================================
|
You'll have to learn to read stack traces.
I get the impression you haven't done any of this before. You may want to stick with java 8 and perhaps find a more knowledgeable peer to help you out. |
Well thanks for all your help. I downgraded all versions to 2.0 from 2.3.1 and now it works. |
hello! how did you solve 4th one? i am getting the same error, i am using maven instead of gradle: [RemoteTestNG] detected TestNG version 6.14.2 SKIPPED CONFIGURATION: @BeforeClass setup2 ===============================================
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
My framework is: Gradle-testng-cucumber-selenium-java.
I have extended my cucumber runner class from AbstractTestNGCucumbertests abstract class imported from cucumber.api.testng.AbstractTestNGCucumberTests.
When I try to run the testng.xml (Which contains the runner class) I get null pointer exception.
My build.gralde looks like:
*** My runner class*****
Expected Behavior
test should run
Current Behavior
I am getting null pointer exception as below:
Let me know if any more detail is required
The text was updated successfully, but these errors were encountered: