Skip to content
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

Zerocode JavaNullPointerException #582

Closed
hpkoolkarni opened this issue Jul 5, 2023 · 9 comments
Closed

Zerocode JavaNullPointerException #582

hpkoolkarni opened this issue Jul 5, 2023 · 9 comments

Comments

@hpkoolkarni
Copy link

hpkoolkarni commented Jul 5, 2023

I am executing a normal unit test using zerocode-tdd version 1.3.34 and junit4 and STS as IDE in corporate settings
Screenshot 2023-07-05 224613
and I am stuck with an error: 0;39mjava.lang.NullPointerException ERROR org.jsmart.zerocode.core.runner.ZeroCodeMultiStepsScenarioRunnerImpl - 34m###Exception while executing a step in the zerocode dsl.
This is my code :
package com.contact;

import org.jsmart.zerocode.core.domain.Scenario;
import org.jsmart.zerocode.core.domain.TargetEnv;
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

@TargetEnv("src/test/resources/contact_host.properties")
@RunWith(ZeroCodeUnitRunner.class)
public class GetContact {

@Test
@Scenario("src/test/resources/api/get_contacts.json")
public void testGetContacts() throws Exception {

}

}
The test is returning the get response of the api but this error is also there and in Expected Response also I am getting {Oops! Not decided. Possible due to non JSON content was encountered. See log for details.}

@hpkoolkarni hpkoolkarni changed the title JavaNullPointerException Zerocode JavaNullPointerException Jul 6, 2023
@sawilkhan
Copy link

Can i work on it?

@hpkoolkarni
Copy link
Author

Can i work on it?

As in? Do you want access to the git repo?

@sawilkhan
Copy link

sawilkhan commented Jul 6, 2023 via email

@arkadiusz97
Copy link

Can i work on it?

As in? Do you want access to the git repo?

Yes or maybe to just part of the repo to reproduce this issue like get_screening_details_by_custid.json, src/test/resources/contact_host.properties and info about project structure. Ofc with removed sensitive business data like passwords, api tokens and so on. Please also share data about your project environment: jdk and maven/gradle versions.

@hpkoolkarni
Copy link
Author

Can i work on it?

As in? Do you want access to the git repo?

Yes or maybe to just part of the repo to reproduce this issue like get_screening_details_by_custid.json, src/test/resources/contact_host.properties and info about project structure. Ofc with removed sensitive business data like passwords, api tokens and so on. Please also share data about your project environment: jdk and maven/gradle versions.

Thank you for getting back. I am using jdk-11 and gradle 7.4.2.I am attaching the folder structure as a photo.
Screenshot 2023-07-07 062057
Even when I am running the helloWorld.java with hello_world_status_ok_assertions which is copied as it is from the zerocode/helloworld repo I am getting the error(java.lang.NullPointerException) the get_contacts file is as below
Screenshot 2023-07-07 062803

@arkadiusz97
Copy link

Can i work on it?

As in? Do you want access to the git repo?

Yes or maybe to just part of the repo to reproduce this issue like get_screening_details_by_custid.json, src/test/resources/contact_host.properties and info about project structure. Ofc with removed sensitive business data like passwords, api tokens and so on. Please also share data about your project environment: jdk and maven/gradle versions.

Thank you for getting back. I am using jdk-11 and gradle 7.4.2.I am attaching the folder structure as a photo. Screenshot 2023-07-07 062057 Even when I am running the helloWorld.java with hello_world_status_ok_assertions which is copied as it is from the zerocode/helloworld repo I am getting the error(java.lang.NullPointerException) the get_contacts file is as below Screenshot 2023-07-07 062803

I was unable to reproduce this problem with those information. Code, project structure and SDKs looks fine. Could you share the repo? You can remove all classes, resources, etc., which are unnecessary to reproduce problem if you don't want to share whole project code. I will try to run it locally and debug.

@authorjapps
Copy link
Owner

Hello @hpkoolkarni , You can clone HelloWorld repo and run the ready-made tests from your laptop/PC and observe where things going wrong in your custom setup.

Link:
https://github.com/authorjapps/zerocode/wiki/Getting-Started#try-at-home-examples

Give it a try and see if you are still facing the issues.

@hpkoolkarni
Copy link
Author

Hello @hpkoolkarni , You can clone HelloWorld repo and run the ready-made tests from your laptop/PC and observe where things going wrong in your custom setup.

Link: https://github.com/authorjapps/zerocode/wiki/Getting-Started#try-at-home-examples

Give it a try and see if you are still facing the issues.

build itself is failing in that repo

@authorjapps
Copy link
Owner

Hello @hpkoolkarni , You can clone HelloWorld repo and run the ready-made tests from your laptop/PC and observe where things going wrong in your custom setup.
Link: https://github.com/authorjapps/zerocode/wiki/Getting-Started#try-at-home-examples
Give it a try and see if you are still facing the issues.

build itself is failing in that repo

That sounds wierd. That repo is used by many developers and testers to set up. Not sure what's going wrong at your end :-(

Is it possible to share a screen record link of how/what you are doing to run the tests, so that we can have a look at?
Please have the details from cloning the repo, building it and then running the tests.
Also have the JDK version printed on the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants