Проблема с запуском тестов. Selenium-Appium-Java-Android

Добрый день. Помогите найти решения проблемы: мои тесты проходят только в режиме DeBug, в Run “java.lang.NullPointerException” , я подозреваю, что-то не то с POM файлом.

Я новичок, поэтому пока мало знаю. Cкорее всего, там вообще некоторые GAV лишние.

<?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>com.example</groupId>
<artifactId>r</artifactId>
<version>1.0</version>
    <build>
    <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>${project.basedir}</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/filtered-manifest</targetPath>
                <includes>
                    <include>AndroidManifest.xml</include>
                </includes>
            </resource>
        </resources>
    </build>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.53.1</version>
    </dependency>
     <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.0</version>
    </dependency>
     <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.1.1</version>
        <scope>test</scope>
     </dependency>
     <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>3.4.0</version>
        <scope>test</scope>
     </dependency>
    <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>2.0.5</version>
        <scope>test</scope>
    </dependency>
</dependencies>
    </project>





А стек трейс где посмотреть ?

java.lang.NullPointerException
	at com.test.Test_ProductsSolution.OpenMainMenu(Test_ProductsSolution.java:24)
	at com.test.Test_ProductsSolution.PS(Test_ProductsSolution.java:36)
	at com.test.Test_ProductsSolution.FindReseller(Test_ProductsSolution.java:81)
	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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
	at org.testng.TestRunner.privateRun(TestRunner.java:757)
	at org.testng.TestRunner.run(TestRunner.java:608)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
	at org.testng.TestNG.run(TestNG.java:999)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:74)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:121)
	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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)


  • Как проект создавали то? У вас pom подсвечивается, как обычный xml, а не рутовый мейвеновский компонент. Нужно создавать / импортировать проект, выбирая правильный тип.
  • Как запускаете debug / run режимы? Что-то мне кажется, что вы запускаете тесты не средствами maven’а, а при помощи testng.
  • Пересмотрите dependencies, многие - не up-to-date.
1 лайк

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