Hi,
I am not able to appium tests using testng suite by invoking my mobile application in genymotion.
When I run my tests, my app is invoked in genymotion but unable to click the element.
public class Example {
@BeforeTest
public void openBrowser() throws MalformedURLException, InterruptedException
{
AndroidDriver driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
System.out.println(driver);
}
@Test
public void cases() throws Exception {
driver.findElementByAccessibilityId(“UPDATE”).click();
}
}
I get this as an output:
Android: null
FAILED: cases
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787)
at org.openqa.selenium.support.ui.FluentWait.(FluentWait.java:96)
at org.openqa.selenium.support.ui.WebDriverWait.(WebDriverWait.java:71)
at org.openqa.selenium.support.ui.WebDriverWait.(WebDriverWait.java:45)
at com.javacodegeeks.testng.maven.TestNgMavenExample.cases(TestNgMavenExample.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
So, I checked the status of appium URL: http://127.0.0.1:4723/wd/hub/status
my response: 200 OK
{
“status”: 0,
“value”: {
“build”: {
“version”: “1.12.1”
}
},
“sessionId”: null
}
I couldn’t understand where am i going wrong. Please help me in resolving it
Thanks in advance