Hello,
I’m trying to set text on a react-native TextInput but everytime Appium gives me a null object reference.
The react-native component:
My tests are in nightwatch js: browser.elementIdValue(‘Email’, ‘test’);
Appium server log:
[HTTP] → POST /wd/hub/session/71a7fab0-09dc-4a0b-9ad9-9965cc904e60/element/Ema
il/value {“value”:[“t”,“e”,“s”,“t”]}
[debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [[“t”,“e”,“s”,“t”],
“Email”,“71a7fab0-09dc-4a0b-9ad9-9965cc904e60”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“element:setText”,“params”:{“elementId”:“Email”,“text”:“test”,“replace”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”
,“action”:“element:setText”,“params”:{“elementId”:“Email”,“text”:“test”,"replace
":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Command returned error:java.lang.Null
PointerException: Attempt to invoke virtual method ‘java.lang.String io.appium.a
ndroid.bootstrap.AndroidElement.getId()’ on a null object reference
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:13,"value
":“Attempt to invoke virtual method ‘java.lang.String io.appium.android.bootstra
p.AndroidElement.getId()’ on a null object reference”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] ← POST /wd/hub/session/71a7fab0-09dc-4a0b-9ad9-9965cc904e60/element/Ema
il/value 500 13 ms - 154
I was thinking that maybe appium could not be finding the element ID but then why would this command: browser…expect.element(‘Email’, ‘id’).to.be.present; works 100%?
Thank you for the help.