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

java.lang.NullPointerException #616

Open
songqingshududu opened this issue Feb 12, 2024 · 4 comments
Open

java.lang.NullPointerException #616

songqingshududu opened this issue Feb 12, 2024 · 4 comments

Comments

@songqingshududu
Copy link

songqingshududu commented Feb 12, 2024

my path: jdk1.8 and windows10
my dependency :

com.sikulix
sikulixapi
2.0.5

my code:
` @SneakyThrows
@test
void test1() {
Runtime.getRuntime().exec("calc.exe");
Thread.sleep(2000);

    Screen screen = new Screen(true);
    screen.click("C:\\Users\\cl\\Desktop\\images\\6.png");
    screen.click("C:\\Users\\cl\\Desktop\\images\\x.png");
    screen.click("C:\\Users\\cl\\Desktop\\images\\7.png");
    screen.click("C:\\Users\\cl\\Desktop\\images\\=.png");

    if (screen.exists("C:\\Users\\cl\\Desktop\\images\\42.png").isValid()) {
        System.out.println("ok!!!!!!!!!!!!!!!!!!");
    }else {
        System.out.println("no!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    }


}`

The following error occurred during the run: java.lang.NullPointerException

@songqingshududu
Copy link
Author

image

@songqingshududu
Copy link
Author

image

@songqingshududu
Copy link
Author

image

@RaiMan
Copy link
Owner

RaiMan commented Apr 28, 2024

Screen screen = new Screen(true);

should be:

Screen screen = new Screen();

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

No branches or pull requests

2 participants