Перейти к содержимому

Фотография

Sikuli - ошибка при закрытии приложения


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 2

#1 pbezpal

pbezpal

    Активный участник

  • Members
  • PipPip
  • 79 сообщений
  • ФИО:Безпалько Павел

Отправлено 17 июня 2019 - 08:12

Всем привет! Начал изучать Sikuli и сразу столкнулся с ошибкой при выполнении функции закрытия приложения. Использую Intelij IDEA 

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.sikuli.script.App;

public class TestITPhoneAuth {

private App itphone;

@Before
public void setUP(){
itphone = App.open("C:\\Program Files (x86)\\SoftPhone\\CLIENT\\SoftPhoneClient.exe");
}

@Test
public void TestITPhoneAuthLogin() throws InterruptedException {
Thread.sleep(3000);
System.out.println("ITPhone open");
}

@After
public void tearDown(){
itphone.close();
}
}

Открывается приложение, но вот ругается на itphone.close();

 

[log] App.open [11284:]
ITPhone open


java.lang.NullPointerException
at TestITPhoneAuth.tearDown(TestITPhoneAuth.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.RunAfters.invokeMethod(RunAfters.java:46)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:349)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:314)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:312)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:292)
at org.junit.runners.ParentRunner.run(ParentRunner.java:396)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Версия JUnit и Sikuli

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>Sikuli</groupId>
<artifactId>Sikuli</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13-beta-1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>


</project>

Может кто сталкивался с пободной ошибкой?

 


  • 0

#2 pbezpal

pbezpal

    Активный участник

  • Members
  • PipPip
  • 79 сообщений
  • ФИО:Безпалько Павел

Отправлено 17 июня 2019 - 08:42

Кажись понял, почему ошибка появляется. При закрытии, приложение требует подтверждения, т.е. его по другому надо обрабатывать


  • 0

#3 pbezpal

pbezpal

    Активный участник

  • Members
  • PipPip
  • 79 сообщений
  • ФИО:Безпалько Павел

Отправлено 17 июня 2019 - 08:45

Да, попробовал открыть другое приложение, которое не требует подтверждения при  закрытии и всё отработало корректно) УРА!!! Всем спасибо)  :smile:


  • 0


Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных