Спасибо за подсказку) Не прокатило Буду делать проверку через Sikuli
- Форум тестировщиков
- → Публикации pbezpal
39 публикаций создано pbezpal (учитываются публикации только с 22 мая 2023)
Отправлено автор: pbezpal 26 июня 2019 - 07:34 в Автоматизированное тестирование
Спасибо за подсказку) Не прокатило Буду делать проверку через Sikuli
Отправлено автор: pbezpal 25 июня 2019 - 13:57 в Автоматизированное тестирование
Вроде разобрался что нужно писать.
package ru.minicom.itphone.client; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; public class RunTests { public static void main(String[] args){ Result result = JUnitCore.runClasses(LoginPageTest.class); System.out.println("Total number of tests " + result.getRunCount()); System.out.println("Total number of test failed " + result.getFailureCount()); for(Failure failure : result.getFailures()){ System.out.println(failure.getMessage()); } System.out.println(result.wasSuccessful()); } }
В pom.xml пописал
<configuration> <archive> <manifest> <mainClass>ru.minicom.itphone.client.RunTests</mainClass> </manifest> </archive> </configuration>
Но при компиляции теперь ругается
D:\Project\ITPhone_Firelink\ver.8.0\Tests\ClientTest>mvn compile [INFO] Scanning for projects... [INFO] [INFO] ------------< TestITPhoneClient:ru.minicom.itphone.client >------------- [INFO] Building TestITPhoneClient 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ru.minicom.itphone.client --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 10 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ ru.minicom.itphone.client --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to D:\Project\ITPhone_Firelink\ver.8.0\Tests\ClientTest\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.158 s [INFO] Finished at: 2019-06-25T16:53:34+03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ru.minicom.itphone.client: Fatal error compiling: invalid flag: --release -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Отправлено автор: pbezpal 25 июня 2019 - 12:36 в Автоматизированное тестирование
Получилось собрать проект в jar
http://forum.vingrad...pic-394115.html
Только теперь при запуске ругается
D:\Project\ITPhone_Firelink\ver.8.0\Tests\ClientTest>java -jar target\ru.minicom-1.0.jar Error: Could not find or load main class mypackage.TestClass
Что нужно указывать вместо mypackage?
Отправлено автор: pbezpal 25 июня 2019 - 11:35 в Автоматизированное тестирование
Смущает, что UIAVerify не может найти это окно. Может в этом всё дело
Отправлено автор: pbezpal 25 июня 2019 - 11:25 в Автоматизированное тестирование
Добавил в проверку ожидание
//Здесь проверяем, что элемент mainWindowBy существует public boolean checkMainWindow(){ try{ new WebDriverWait(driver, 20).until(ExpectedConditions.presenceOfElementLocated(mainWindowBy)); return true; }catch(NoSuchElementException e){ return false; } }
И получил ошибку
"C:\Program Files\Java\jdk1.8.0_201\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\lib\idea_rt.jar=21067:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\plugins\junit\lib\junit-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_201\jre\lib\rt.jar;D:\Project\ITPhone_Firelink\ver.8.0\Tests\ClientTest\target\test-classes;D:\Project\ITPhone_Firelink\ver.8.0\Tests\ClientTest\target\classes;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;C:\Users\pbezpal\.m2\repository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;C:\Users\pbezpal\.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\pbezpal\.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\pbezpal\.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\pbezpal\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\pbezpal\.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\pbezpal\.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\pbezpal\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\pbezpal\.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\pbezpal\.m2\repository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;C:\Users\pbezpal\.m2\repository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;C:\Users\pbezpal\.m2\repository\junit\junit\4.13-beta-1\junit-4.13-beta-1.jar;C:\Users\pbezpal\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\pbezpal\.m2\repository\com\sikulix\sikulixapi\1.1.2\sikulixapi-1.1.2.jar;C:\Users\pbezpal\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;C:\Users\pbezpal\.m2\repository\commons-net\commons-net\3.4\commons-net-3.4.jar;C:\Users\pbezpal\.m2\repository\com\github\tulskiy\jkeymaster\1.2\jkeymaster-1.2.jar;C:\Users\pbezpal\.m2\repository\net\java\dev\jna\jna\4.2.1\jna-4.2.1.jar;C:\Users\pbezpal\.m2\repository\org\slf4j\slf4j-api\1.7.13\slf4j-api-1.7.13.jar;C:\Users\pbezpal\.m2\repository\org\slf4j\slf4j-nop\1.7.25\slf4j-nop-1.7.25.jar;C:\Users\pbezpal\.m2\repository\com\melloware\jintellitype\1.3.7\jintellitype-1.3.7.jar;C:\Users\pbezpal\.m2\repository\com\nativelibs4java\bridj\0.7.0\bridj-0.7.0.jar;C:\Users\pbezpal\.m2\repository\com\google\android\tools\dx\1.7\dx-1.7.jar;C:\Users\pbezpal\.m2\repository\com\sikulix\sikulixlibswin\1.1.1\sikulixlibswin-1.1.1.jar;C:\Users\pbezpal\.m2\repository\com\sikulix\sikulix2tigervnc\2.0.0-SNAPSHOT\sikulix2tigervnc-2.0.0-20180306.143551-15.jar;C:\Users\pbezpal\.m2\repository\com\github\vidstige\jadb\94ebf38\jadb-94ebf38.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 MainPageTest,testCallMainWindowIconTree июн 25, 2019 2:21:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS [log] CLICK on L(1648,1060)@S(0)[0,0 1920x1080] (547 msec) org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of element located by: By.className: TfrmMain (tried for 60 second(s) with 500 milliseconds interval) at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:95) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:272) at MainPage.checkMainWindow(MainPage.java:64) at MainPageTest.testCallMainWindowIconTree(MainPageTest.java:43) 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.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 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) Caused by: org.openqa.selenium.NoSuchElementException: Element cannot be found (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DESKTOP-CBDE5N6', ip: '10.10.11.68', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {app: C:\Program Files (x86)\Soft..., args: , debugConnectToRunningApp: false, innerPort: 9998, javascriptEnabled: true, keyboardSimulator: 1, launchDelay: 5, platform: ANY, platformName: ANY} Session ID: AwesomeSession *** Element info: {Using=class name, value=TfrmMain} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40) at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80) at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323) at org.openqa.selenium.remote.RemoteWebDriver.findElementByClassName(RemoteWebDriver.java:412) at org.openqa.selenium.By$ByClassName.findElement(By.java:389) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315) at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:182) at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:179) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:249) ... 27 more Process finished with exit code -1
Отправлено автор: pbezpal 25 июня 2019 - 09:03 в Автоматизированное тестирование
Всем привет!
Написал тест для проверки появления окна при определенных действиях. Ищу окно по параметру className. Вот мой код для проверки существования окна
import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.sikuli.script.FindFailed; import org.sikuli.script.Pattern; import org.sikuli.script.Screen; import java.awt.*; import java.awt.event.KeyEvent; public class MainPage { HelperClass hclass = new HelperClass(); private Screen screen; private WebDriver driver; private By iconAdditionalClientTreeBy = By.name("Поиск контакта"); private By treeBy = By.name("Шеврон уведомления"); private By mainWindowBy = By.className("TfrmMain"); //Вот этот className private Pattern imgIconClientTreeBy = hclass.newPattern("tree.JPG"); private Pattern imgMainWindowMenu = hclass.newPattern("mainWindowMenu.jpg"); private Pattern imgExitButton = hclass.newPattern("exit.jpg"); private Robot robot; public MainPage(Screen screen, WebDriver driver){ this.screen = screen; this.driver = driver; } //Проверяем, есть ли дополнительная иконка клиента public boolean checkIconAdditionalClientTree(){ try{ new WebDriverWait(driver, 60).until(ExpectedConditions.presenceOfElementLocated(iconAdditionalClientTreeBy)); return true; }catch (NoSuchElementException e){ return false; } } public void callMainWindowHotButtons() throws AWTException { robot = new Robot(); if(checkIconAdditionalClientTree()){ robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_SHIFT); robot.keyPress(KeyEvent.VK_F1); } } public void callMainWindowIconTree(String login) throws FindFailed { if(checkIconAdditionalClientTree()){ screen.click(imgIconClientTreeBy); driver.findElement(By.name("[" + login + "] - В сети")).click(); } } //Здесь проверяем, что элемент mainWindowBy существует public boolean checkMainWindow(){ try{ driver.findElement(mainWindowBy); return true; }catch(NoSuchElementException e){ return false; } } public void clickExitButton() throws FindFailed { screen.click(imgMainWindowMenu); screen.click(imgExitButton); } }
Вот тест для проверки окна
import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import org.sikuli.script.FindFailed; import org.sikuli.script.Screen; import java.io.File; import java.io.IOException; import java.net.URL; public class MainPageTest { private Process shell; private WebDriver driver; private Screen screen; private String profile = System.getProperty("user.home") + "\\AppData\\Roaming\\IT-Phone\\Profiles";; private boolean windowMain; private String login; private String password; private String server; @Before public void setUp() throws IOException { StartTest start = new StartTest(); shell = start.RunWinum(); start.deleteFolderProfile(new File(profile)); driver = new RemoteWebDriver(new URL("http://localhost:9999"), start.startClient()); screen = new Screen(); } @Test public void testCallMainWindowIconTree() throws FindFailed { MainPage mainPage = new MainPage(screen, driver); LoginPage loginPage = new LoginPage(screen, driver); login = "2001"; password = "o0cJ2uas"; server = "172.22.50.100"; loginPage.enterDataFields(login, password, server); loginPage.clickEnterButton(); mainPage.checkIconAdditionalClientTree(); mainPage.callMainWindowIconTree(login); windowMain = mainPage.checkMainWindow(); mainPage.clickExitButton(); System.out.println(windowMain); Assert.assertTrue(windowMain); } @After public void tearDown(){ shell.destroy(); } }
Тест выдаёт результат false, хотя вижу, что окно появляется
Отправлено автор: pbezpal 24 июня 2019 - 09:43 в Автоматизированное тестирование
Всем привет!
Пытаюсь собрать Maven в jar файл средствами Intellij Idea. В интернете пишут, что нужно всего лишь сделать структуру pom.xml файла нужную и всё заработает. У меня pom.xml получился следующий
<?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>TestITPhoneClient</groupId> <artifactId>ru.minicom</artifactId> <packaging>jar</packaging> <version>1.0</version> <name>TestITPhoneClient</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.141.59</version> </dependency> <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> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.1.2</version> <configuration> <archive> <manifest> <mainClass>TestClass</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> </project>
При сборке никак не хочет появляться jar файл в директории target. В чём ошибка?
Отправлено автор: pbezpal 21 июня 2019 - 14:49 в Автоматизированное тестирование
Всем привет.
Начал только разбираться в этой связке. Сделал несколько тестов, все работает, как ни странно) Но вот столкнулся с такой задачкой. Открываю форму поиска серверов и хотелось бы найти нужный сервер и выбрать его. Например, выбрать сервер выделенный красным с IP 10.10.11.181. Спасибо.
Отправлено автор: pbezpal 19 июня 2019 - 12:39 в Selenium - Functional Testing
При выполнении теста у меня в ветке verify element present выдаёт такое сообщение. Я так понимаю Selenuim IDE не умеет работать с AJAX?
Отправлено автор: pbezpal 17 июня 2019 - 08:45 в Автоматизированное тестирование
Да, попробовал открыть другое приложение, которое не требует подтверждения при закрытии и всё отработало корректно) УРА!!! Всем спасибо)
Отправлено автор: pbezpal 17 июня 2019 - 08:42 в Автоматизированное тестирование
Кажись понял, почему ошибка появляется. При закрытии, приложение требует подтверждения, т.е. его по другому надо обрабатывать
Отправлено автор: pbezpal 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>
Может кто сталкивался с пободной ошибкой?
Отправлено автор: pbezpal 10 июня 2019 - 11:33 в Selenium - Functional Testing
Отправлено автор: pbezpal 10 июня 2019 - 11:27 в Selenium - Functional Testing
Community Forum Software by IP.Board Русификация от IBResource
Лицензия зарегистрирована на: Software-Testing.Ru