Getting java.lang.NullPointerException for android native app

package Policybazaar;

import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Before;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

public class login {

private RemoteWebDriver driver;

@Before
public void setUp() throws MalformedURLException {
	// Set up desired capabilities and pass the Android app-activity and
	// app-package to Appium
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("BROWSER_NAME", "Android");
	capabilities.setCapability("VERSION", "5.0.2");
	capabilities.setCapability("deviceName", "ZX1D64M6BG");
	capabilities.setCapability("platformName", "Android");
	capabilities.setCapability("appPackage", "com.policybazaar");
	capabilities.setCapability("appActivity",
			"com.policybazaar.login.Splash_DashBoard");
	driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),
			capabilities);
}

@Test
public void login() {

	WebElement MobileNo = driver.findElement(By.className("android.widget.EditText"));
	MobileNo.sendKeys("9654344491");
	WebElement submitbutton = driver.findElement(By.className("android.widget.Button"));
	submitbutton.click();

	try {
		Thread.sleep(2000);
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}

// @AfterClass
// public void teardown(){
// //close the app
// driver.quit();
// }
}

Could you paste the error log?

below is error :-[TestNG] Running:
C:\Users\snigdhan\AppData\Local\Temp\testng-eclipse-1147031650\testng-customsuite.xml

FAILED: login
java.lang.NullPointerException
at Policybazaar.login.login(login.java:36)
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:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
at org.testng.TestNG.run(TestNG.java:1018)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@5ffe2c10: 10 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@450b9338: 112 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@59887d29: 10 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@4f8d0299: 10 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 10 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@2fb212f0: 40 ms

For 1st field ie Enter Your Mobile No.i ma using resource id[com.policybazaar:id/mobile_number_edittext] an even class name[android.widget.EditText]for both fileds,but still same error

i did along with screenshot

Just to rule out that locator is not the issue. Can you try this locator and see if it is still failing with nullpointerexception.

xpath("//android.widget.Button[@text='Enter Your Mobile No.']")

and what abt click button,please share the x path for same

@tini

Can you please share the appium log

plz see appium logs

info: → POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“Android”,“deviceName”:“ZX1D64M6BG”,“VERSION”:“5.0.2”,“appActivity”:“com.policybazaar.login.Splash_DashBoard”,“appPackage”:“com.policybazaar”,“BROWSER_NAME”:“Android”}}
info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.7.0_71)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : VERSION, BROWSER_NAME
info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session fc80c7c0-9302-49d1-a8a4-48e538b90236
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.7.0_71
info: [debug] Checking whether adb is present
info: [debug] Using adb from F:\Android\sdk\platform-tools\adb.exe
warn: No app capability, can’t parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices

info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device ZX1D64M6BG
info: [debug] Setting device id to ZX1D64M6BG
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG wait-for-device
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 21
info: Device API level is: 21
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn’t exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “rm -rf /data/local/tmp/strings.json”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device

info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device

info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device

info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”
info: Starting App
info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.policybazaar -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json

info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “dumpsys window”
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“/data/local/tmp”}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:false}
info: [debug] Getting device API level
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 21
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.policybazaar/com.policybazaar.login.Splash_DashBoard”
info: [debug] Waiting for pkg “com.policybazaar” and activity “com.policybazaar.login.Splash_DashBoard” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “dumpsys window windows”
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “getprop ro.build.version.release”
info: [debug] Device is at release version 5.0.2
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId fc80c7c0-9302-49d1-a8a4-48e538b90236
info: ← POST /wd/hub/session 303 22139.730 ms - 74
info: → GET /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“5.0.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“ZX1D64M6BG”,“VERSION”:“5.0.2”,“appActivity”:“com.policybazaar.login.Splash_DashBoard”,“appPackage”:“com.policybazaar”,“BROWSER_NAME”:“Android”},“platformName”:“Android”,“deviceName”:“ZX1D64M6BG”,“VERSION”:“5.0.2”,“appActivity”:“com.policybazaar.login.Splash_DashBoard”,“appPackage”:“com.policybazaar”,“BROWSER_NAME”:“Android”},“sessionId”:“fc80c7c0-9302-49d1-a8a4-48e538b90236”}
info: ← GET /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236 200 0.649 ms - 693 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“5.0.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“ZX1D64M6BG”,“VERSION”:“5.0.2”,“appActivity”:“com.policybazaar.login.Splash_DashBoard”,“appPackage”:“com.policybazaar”,“BROWSER_NAME”:“Android”},“platformName”:“Android”,“deviceName”:“ZX1D64M6BG”,“VERSION”:“5.0.2”,“appActivity”:“com.policybazaar.login.Splash_DashBoard”,“appPackage”:“com.policybazaar”,“BROWSER_NAME”:“Android”},“sessionId”:“fc80c7c0-9302-49d1-a8a4-48e538b90236”}
info: → POST /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236/element {“using”:“class name”,“value”:“android.widget.EditText”}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“class name”,“selector”:“android.widget.EditText”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.EditText”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding android.widget.EditText using CLASS_NAME with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.EditText, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
info: [debug] [BOOTSTRAP] [debug] Finding android.widget.EditText using CLASS_NAME with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.EditText, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:7,“value”:“No element found”}
info: [debug] Condition unmet after 1213ms. Timing out.
info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”,“origValue”:“No element found”},“sessionId”:“fc80c7c0-9302-49d1-a8a4-48e538b90236”}
info: ← POST /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236/element 500 1219.030 ms - 195
info: → DELETE /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236 {}
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: F:\Android\sdk\platform-tools\adb.exe -s ZX1D64M6BG shell “input keyevent 3”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] Sent shutdown command, waiting for UiAutomator to stop

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 6.459
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“fc80c7c0-9302-49d1-a8a4-48e538b90236”}
info: ← DELETE /wd/hub/session/fc80c7c0-9302-49d1-a8a4-48e538b90236 200 1138.804 ms - 76 {“status”:0,“value”:null,“sessionId”:“fc80c7c0-9302-49d1-a8a4-48e538b90236”}

can i user com.policybazaar:id/mobile_number_edittext as By.id(“mobile_number_edittext”)

Hi @tini

There are so much different ways to locate elements. I prefer to use with xpath. But there is nothing wrong with your locating method it is working correct. Just do below modifications to your code and try.

  1. Remove below capabilities. Coz appium log said appium can’t find it.
    capabilities.setCapability(“BROWSER_NAME”, “Android”);
    capabilities.setCapability(“VERSION”, “5.0.2”);

  2. Add below capability. It is your android version
    capabilities.setCapability(“platformVersion”, “5.0.2”);

  3. Then add below code to @Test. This code use to wait until the element present. Add this before “WebElement MobileNo = driver.findElement(By.className(“android.widget.EditText”));”

WebElement expelement=(WebElement) (new WebDriverWait(driver, 15)).until(ExpectedConditions.presenceOfElementLocated(By.className(“android.widget.EditText”)));

So @Test should be like,

@Test
public void login() {

	WebElement expelement=(WebElement) (new WebDriverWait(driver, 15)).until(ExpectedConditions.presenceOfElementLocated(By.className("android.widget.EditText")));
	WebElement MobileNo = driver.findElement(By.className("android.widget.EditText"));
	MobileNo.sendKeys("9654344491");
	WebElement submitbutton = driver.findElement(By.className("android.widget.Button"));
	submitbutton.click();

	try {
		Thread.sleep(2000);
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}

Try this :slightly_smiling:

thanx it works and now i m able to proceed

1 Like

Need help ,how to proceed with below scenario,having to screenshot where i am able to locate element and execute my code till “Are you a tobacco user:” but after that my code gives error

FAILED: term
org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 381 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:55:52’
System info: host: ‘PB119AS005’, ip: ‘10.0.32.232’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.7.0_71’
*** Element info: {Using=name, value=Married}
Session ID: e7de4676-3d0d-480a-8c3b-0e744608f734
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, javascriptEnabled=true, appActivity=com.policybazaar.login.Splash_DashBoard, browserName=Android, networkConnectionEnabled=true, desired={platformVersion=5.0.2, deviceName=ZX1D64M6BG, platformName=Android, appActivity=com.policybazaar.login.Splash_DashBoard, appPackage=com.policybazaar}, locationContextEnabled=false, appPackage=com.policybazaar, platformVersion=5.0.2, databaseEnabled=false, deviceName=ZX1D64M6BG, platformName=Android, webStorageEnabled=false, warnings={}, takesScreenshot=true}]
at sun.reflect.GeneratedConstructorAccessor10.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:451)
at org.openqa.selenium.By$ByName.findElement(By.java:303)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at Policybazaar.PBlogin.term(PBlogin.java:106)
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:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
at org.testng.TestNG.run(TestNG.java:1018)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

screnshot 1 where i am able to run my code

Screenshot 2 : where i m facing error,i guess its because of scroll issue ,please help

Can you please share the appium log and your code

selenium latest version 3.5.2 throwing NullPointerExpection for all WebElements.
I try to resolve this issue in my whole day, then I just downgrade the selenium version with 3.4.0, Now its working. Could you please guide me why the selenium latest version is not supporting the WebElements with the appium?

I tried all elements with click(), clear(), sendkeys() and getText(), getAttribute() etc.

Please refer below exception log:

java.lang.NullPointerException
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:275)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:99)
at com.shineSauceLabs.config.BaseClass.existingUserLogin(BaseClass.java:198)
at com.shineSauceLabs.config.CommonMethods.Login_TogetResume(CommonMethods.java:888)
at com.shineSauceLabs.Main.TestShineApp_GetResume.test2_goto_ShineCandApp_Login_RegisteredUser(TestShineApp_GetResume.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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

@shabana-parveen vocĂȘ salvou minha vida! Fiz isso, fiz o downgrade e deu certo. Muito obrigado