appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.22k stars 758 forks source link

getConnection() method throws NPE #1920

Closed wazzeps closed 1 year ago

wazzeps commented 1 year ago

Description

Since java-client 8.4.0 getConnection() method from HasNetworkConnection interface throws NPE.

setConnection() doesn't work too as it uses getConnection().

Environment

Code To Reproduce Issue [ Good To Have ]

driver.getConnection();

Exception Stacktraces

java.lang.NullPointerException at io.appium.java_client.android.connection.HasNetworkConnection.getConnection(HasNetworkConnection.java:73)

Link To Appium Logs

[HTTP] {"script":"mobile: getConnectivity","args":[]} [debug] [AndroidUiautomator2Driver@3e00 (99b37702)] Calling AppiumDriver.execute() with args: ["mobile: getConnectivity",[],"99b37702-f100-49c5-99da-ab0155789b55"] [AndroidUiautomator2Driver@3e00 (99b37702)] Executing native command 'mobile: getConnectivity' [debug] [AndroidUiautomator2Driver@3e00 (99b37702)] Responding to client with driver.execute() result: {} [HTTP] <-- POST /session/99b37702-f100-49c5-99da-ab0155789b55/execute/sync 200 2 ms - 12

mykola-mokhnach commented 1 year ago

This must be a bug in the driver itself. Please update it to the most recent version and try again

wazzeps commented 1 year ago

driver uiautomator2 updated: 2.24.0 => 2.24.1

Now it's working. Thanks!