Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure

Actually, I am new on Appium, just want to open Calculator on Android Studio emulator, and I have just test some script example from internet. However, got the following error on IntelliJ IDEA CE

Appium version: 2.0.0beta

/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=65451:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/testng/lib/testng-rt.jar:/Users/raymond/Downloads/appium_test/AppiumTest_Java_And_iOS-master/target/classes:/Users/raymond/.m2/repository/org/testng/testng/7.0.0/testng-7.0.0.jar:/Users/raymond/.m2/repository/com/beust/jcommander/1.72/jcommander-1.72.jar:/Users/raymond/.m2/repository/io/appium/java-client/7.3.0/java-client-7.3.0.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-java/3.141.59/selenium-java-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-chrome-driver/3.141.59/selenium-chrome-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-edge-driver/3.141.59/selenium-edge-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-firefox-driver/3.141.59/selenium-firefox-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-ie-driver/3.141.59/selenium-ie-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-opera-driver/3.141.59/selenium-opera-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-remote-driver/3.141.59/selenium-remote-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-safari-driver/3.141.59/selenium-safari-driver-3.141.59.jar:/Users/raymond/.m2/repository/net/bytebuddy/byte-buddy/1.8.15/byte-buddy-1.8.15.jar:/Users/raymond/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar:/Users/raymond/.m2/repository/com/google/guava/guava/25.0-jre/guava-25.0-jre.jar:/Users/raymond/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/raymond/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:/Users/raymond/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:/Users/raymond/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/Users/raymond/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/Users/raymond/.m2/repository/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar:/Users/raymond/.m2/repository/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-support/3.141.59/selenium-support-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-api/3.141.59/selenium-api-3.141.59.jar:/Users/raymond/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/Users/raymond/.m2/repository/org/apache/httpcomponents/httpclient/4.5.9/httpclient-4.5.9.jar:/Users/raymond/.m2/repository/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar:/Users/raymond/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/raymond/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/raymond/.m2/repository/cglib/cglib/3.2.12/cglib-3.2.12.jar:/Users/raymond/.m2/repository/org/ow2/asm/asm/7.1/asm-7.1.jar:/Users/raymond/.m2/repository/commons-validator/commons-validator/1.6/commons-validator-1.6.jar:/Users/raymond/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/Users/raymond/.m2/repository/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar:/Users/raymond/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/raymond/.m2/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar:/Users/raymond/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/Users/raymond/.m2/repository/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-aop/5.1.8.RELEASE/spring-aop-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-beans/5.1.8.RELEASE/spring-beans-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-jcl/5.1.8.RELEASE/spring-jcl-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-expression/5.1.8.RELEASE/spring-expression-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/aspectj/aspectjweaver/1.9.4/aspectjweaver-1.9.4.jar:/Users/raymond/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar com.intellij.rt.testng.RemoteTestNGStarter -usedefaultlisteners false -socket65450 @w@/private/var/folders/hf/qn57dq49185ct6nm6qjs35zc0000gp/T/idea_working_dirs_testng.tmp -temp /private/var/folders/hf/qn57dq49185ct6nm6qjs35zc0000gp/T/idea_testng.tmp

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘Pro02’, ip: ‘fe80:0:0:0:802:7365:26f4:37b7%en0’, os.name: ‘Mac OS X’, os.arch: ‘aarch64’, os.version: ‘13.2.1’, java.version: ‘19.0.2’
Driver info: driver.version: RemoteWebDriver

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:573)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at src_Appium.Calculator.setUp(Calculator.java:28)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:62)
at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:340)
at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:294)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.testng.TestRunner.privateRun(TestRunner.java:770)
at org.testng.TestRunner.run(TestRunner.java:591)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:402)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:396)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
at org.testng.SuiteRunner.run(SuiteRunner.java:304)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1180)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1102)
at org.testng.TestNG.runSuites(TestNG.java:1032)
at org.testng.TestNG.run(TestNG.java:1000)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)

Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:456)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:175)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:318)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:282)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:167)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
… 27 more

Test ignored.

===============================================
Default Suite
Total tests run: 1, Passes: 0, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1

Process finished with exit code 0

Here is my code

package src_Appium;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.*;

public class Calculator {
WebDriver driver;

@BeforeClass
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("deviceName", "emulator-5554");
    capabilities.setCapability("platformVersion", "11");
    capabilities.setCapability("platformName","emulator-5554");
    capabilities.setCapability("appPackage", "com.android.calculator2");

// This package name of your app (you can get it from apk info app)
capabilities.setCapability(“appActivity”,“com.android.calculator2.Calculator”); // This is Launcher activity of your app (you can get it from apk info app)
//Create RemoteWebDriver instance and connect to the Appium server
//It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities
driver = new RemoteWebDriver(new URL(“https://127.0.0.1:4723/wd/hub”), capabilities);
}

@Test
public void testCal() throws Exception {
    //locate the Text on the calculator by using By.name()
    WebElement two=driver.findElement(By.name("2"));
    two.click();
    WebElement plus=driver.findElement(By.name("+"));
    plus.click();
    WebElement four=driver.findElement(By.name("4"));
    four.click();
    WebElement equalTo=driver.findElement(By.name("="));
    equalTo.click();
    //locate the edit box of the calculator by using By.tagName()
    WebElement results=driver.findElement(By.tagName("EditText"));
    //Check the calculated value on the edit box
    assert results.getText().equals("6"):"Actual value is : "+results.getText()+" did not match with expected value: 6";

}

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

}

It seems like you are following some tutorial, and if so it would make things a lot easier if you would post a link to it and say where things go wrong.

Here is a very thorough and long description of the Selenium/Webdriver architechture and history:

http://www.aosabook.org/en/selenium.html

Why am I pointing you to that? It has a very pithy explanation of why you shouldn’t use RemoteWebDriver to initialize a session unless you are using Selenium Hub/Grid or the like. I’ll quote it for you:

RemoteWebDriver: This driver class comes directly from the upstream Selenium project. This is a pretty generic driver where initializing the driver means making network requests to a Selenium hub to start a driver session. Since Appium operates on the client-server model, Appium uses this to initialize a driver session. However, directly using the RemoteWebDriver is not recommended since there are other drivers available that offer additional features or convenience functions.

My best advice for any beginner in Appium is to find a good tutorial and follow it. When things go wrong, always give the programming language that you are coding with and a very narrow definition of what you are trying to accomplish. In my experience, these are the questions that get the best answers.

I were observing similar exception while trying to connect to a “https” endpoint while the server was actually using plain http protocol

Thank you for your advise on this @wreed, I will have a look on your website

Actually, I have followed some tutorial and link is as below:

I have just modified like capabilities.setCapability(“BROWSER_NAME”, “Android”) to fit my Android Studio emulator

Yeah, I read through that and I don’t see why that person is using RemoteWebDriver :man_shrugging:

Here is another one for Calculator that uses AndroidDriver. Could you give it a try?
https://www.pavantestingtools.com/2019/02/handling-calculator-using-appium.html

thank you @wreed for your help. after I changed to use the real device and try your given website. it is working now

Listed the IDE log for your reference (server log in below)

/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=52224:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Users/raymond/Downloads/appium_test_03/appium_test_03/target/test-classes:/Users/raymond/Downloads/appium_test_03/appium_test_03/target/classes:/Users/raymond/.m2/repository/org/testng/testng/7.1.0/testng-7.1.0.jar:/Users/raymond/.m2/repository/com/beust/jcommander/1.72/jcommander-1.72.jar:/Users/raymond/.m2/repository/com/google/inject/guice/4.1.0/guice-4.1.0-no_aop.jar:/Users/raymond/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/raymond/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/raymond/.m2/repository/org/yaml/snakeyaml/1.21/snakeyaml-1.21.jar:/Users/raymond/.m2/repository/io/appium/java-client/7.3.0/java-client-7.3.0.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-java/3.141.59/selenium-java-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-chrome-driver/3.141.59/selenium-chrome-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-edge-driver/3.141.59/selenium-edge-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-firefox-driver/3.141.59/selenium-firefox-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-ie-driver/3.141.59/selenium-ie-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-opera-driver/3.141.59/selenium-opera-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-remote-driver/3.141.59/selenium-remote-driver-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-safari-driver/3.141.59/selenium-safari-driver-3.141.59.jar:/Users/raymond/.m2/repository/net/bytebuddy/byte-buddy/1.8.15/byte-buddy-1.8.15.jar:/Users/raymond/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar:/Users/raymond/.m2/repository/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar:/Users/raymond/.m2/repository/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-support/3.141.59/selenium-support-3.141.59.jar:/Users/raymond/.m2/repository/org/seleniumhq/selenium/selenium-api/3.141.59/selenium-api-3.141.59.jar:/Users/raymond/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/Users/raymond/.m2/repository/org/apache/httpcomponents/httpclient/4.5.9/httpclient-4.5.9.jar:/Users/raymond/.m2/repository/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar:/Users/raymond/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/raymond/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/raymond/.m2/repository/cglib/cglib/3.2.12/cglib-3.2.12.jar:/Users/raymond/.m2/repository/org/ow2/asm/asm/7.1/asm-7.1.jar:/Users/raymond/.m2/repository/commons-validator/commons-validator/1.6/commons-validator-1.6.jar:/Users/raymond/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/Users/raymond/.m2/repository/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar:/Users/raymond/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/raymond/.m2/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar:/Users/raymond/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/Users/raymond/.m2/repository/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-aop/5.1.8.RELEASE/spring-aop-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-beans/5.1.8.RELEASE/spring-beans-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-jcl/5.1.8.RELEASE/spring-jcl-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/springframework/spring-expression/5.1.8.RELEASE/spring-expression-5.1.8.RELEASE.jar:/Users/raymond/.m2/repository/org/aspectj/aspectjweaver/1.9.4/aspectjweaver-1.9.4.jar:/Users/raymond/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar:/Users/raymond/.m2/repository/com/google/guava/guava/28.2-jre/guava-28.2-jre.jar:/Users/raymond/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/raymond/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/raymond/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/raymond/.m2/repository/org/checkerframework/checker-qual/2.10.0/checker-qual-2.10.0.jar:/Users/raymond/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar:/Users/raymond/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar SystemApps.Calculator
Feb 22, 2023 4:06:36 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: W3C
Exception in thread “main” org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘Raymond.local’, ip: ‘fe80:0:0:0:462:3008:40ca:60cf%en0’, os.name: ‘Mac OS X’, os.arch: ‘aarch64’, os.version: ‘13.2.1’, java.version: ‘19.0.2’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.android.calculator2.Cal…, appPackage: com.google.android.calculator, automationName: Appium, databaseEnabled: false, desired: {appActivity: com.android.calculator2.Cal…, appPackage: com.google.android.calculator, automationName: Appium, deviceName: QV7810JB8G, platformName: android, platformVersion: 11}, deviceApiLevel: 30, deviceManufacturer: Sony, deviceModel: XQ-BC72, deviceName: QV7810JB8G, deviceScreenDensity: 420, deviceScreenSize: 1096x2560, deviceUDID: QV7810JB8G, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, platform: LINUX, platformName: Android, platformVersion: 11, statBarHeight: 63, takesScreenshot: true, viewportRect: {height: 2371, left: 0, top: 63, width: 1096}, warnings: {}, webStorageEnabled: false}
Session ID: f2af8635-a07f-4872-af0b-d9066b37624d
*** Element info: {Using=id, value=com.android.calculator2:id/digit_7}
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:61)
at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.findElement(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:372)
at io.appium.java_client.DefaultGenericMobileDriver.findElementById(DefaultGenericMobileDriver.java:69)
at io.appium.java_client.AppiumDriver.findElementById(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.findElementById(AndroidDriver.java:1)
at SystemApps.Calculator.main(Calculator.java:37)

Process finished with exit code 1

Here is the appium server log

The server is running
[h-t-t-p] Waiting until the server is closed
[h-t-t-p] Received server close event
[Appium] Welcome to Appium v1.22.0
[Appium] Non-default server args:
[Appium] relaxedSecurityEnabled: true
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST h-t-t-p interface listener started on 0.0.0.0:4723
[h-t-t-p] --> POST /wd/hub/session
[h-t-t-p] {“desiredCapabilities”:{“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”},“capabilities”:{“firstMatch”:[{“appium:appActivity”:“com.android.calculator2.Calculator”,“appium:appPackage”:“com.google.android.calculator”,“appium:automationName”:“Appium”,“appium:deviceName”:“QV7810JB8G”,“platformName”:“android”,“appium:platformVersion”:“11”}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”},null,{“firstMatch”:[{“appium:appActivity”:“com.android.calculator2.Calculator”,“appium:appPackage”:“com.google.android.calculator”,“appium:automationName”:“Appium”,“appium:deviceName”:“QV7810JB8G”,“platformName”:“android”,“appium:platformVersion”:“11”}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1677053182149 (16:06:22 GMT+0800 (Hong Kong Standard Time))
[Appium]
[Appium] ======================================================================
[Appium] DEPRECATION WARNING:
[Appium]
[Appium] The ‘automationName’ capability was not provided in the desired
[Appium] capabilities for this Android session
[Appium]
[Appium] Setting ‘automationName=UiAutomator2’ by default and using the
[Appium] UiAutomator2 Driver
[Appium]
[Appium] The next major version of Appium (2.x) will require the
[Appium] ‘automationName’ capability to be set for all sessions on all
[Appium] platforms
[Appium]
[Appium] In previous versions (Appium <= 1.13.x), the default was
[Appium] ‘automationName=UiAutomator1’
[Appium]
[Appium] If you wish to use that automation instead of UiAutomator2, please
[Appium] add ‘automationName=UiAutomator1’ to your desired capabilities
[Appium]
[Appium] For more information about drivers, please visit
[Appium] h-t-t-p://appium.io/docs/en/about-appium/intro/ and explore the
[Appium] ‘Drivers’ menu
[Appium]
[Appium] ======================================================================
[Appium]
[Appium] Appium v1.22.0 creating new AndroidUiautomator2Driver (v1.69.0) session
[Appium] Applying relaxed security to ‘AndroidUiautomator2Driver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “platformName”: “android”,
[BaseDriver] “appium:appActivity”: “com.android.calculator2.Calculator”,
[BaseDriver] “appium:appPackage”: “com.google.android.calculator”,
[BaseDriver] “appium:automationName”: “Appium”,
[BaseDriver] “appium:deviceName”: “QV7810JB8G”,
[BaseDriver] “appium:platformVersion”: “11”
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] Session created with session id: f2af8635-a07f-4872-af0b-d9066b37624d
[UiAutomator2] Starting ‘com.google.android.calculator’ directly on the device
[ADB] Found 5 ‘build-tools’ folders under ‘/Users/raymond/Library/Android/sdk’ (newest first):
[ADB] /Users/raymond/Library/Android/sdk/build-tools/34.0.0-rc1
[ADB] /Users/raymond/Library/Android/sdk/build-tools/33.0.2
[ADB] /Users/raymond/Library/Android/sdk/build-tools/33.0.1
[ADB] /Users/raymond/Library/Android/sdk/build-tools/30.0.3
[ADB] /Users/raymond/Library/Android/sdk/build-tools/29.0.2
[ADB] Using ‘adb’ from ‘/Users/raymond/Library/Android/sdk/platform-tools/adb’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 start-server’
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices
[ADB] Connected devices: [{“udid”:“QV7810JB8G”,“state”:“device”}]
[AndroidDriver] Looking for a device with Android ‘11.0.0’
[ADB] Setting device id to QV7810JB8G
[ADB] Getting device platform version
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell getprop ro.build.version.release’
[ADB] Current device property ‘ro.build.version.release’: 11
[AndroidDriver] Using device: QV7810JB8G
[ADB] Using ‘adb’ from ‘/Users/raymond/Library/Android/sdk/platform-tools/adb’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 start-server’
[ADB] Setting device id to QV7810JB8G
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell getprop ro.build.version.sdk’
[ADB] Current device property ‘ro.build.version.sdk’: 30
[ADB] Getting device platform version
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell getprop ro.build.version.release’
[ADB] Current device property ‘ro.build.version.release’: 11
[ADB] Device API level: 30
[UiAutomator2] Relaxing hidden api policy
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell ‘settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1’’
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G wait-for-device’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell echo ping’
[AndroidDriver] Pushing settings apk to device…
[ADB] Getting install status for io.appium.settings
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys package io.appium.settings’
[ADB] ‘io.appium.settings’ is not installed
[ADB] App ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk’ is not installed
[ADB] Installing ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G help’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G features’
[ADB] The application at ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G install -g ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk’’
[ADB] The installation of ‘settings_apk-debug.apk’ took 5749ms
[ADB] Install command stdout: Performing Streamed Install
[ADB] Success
[ADB] Getting IDs of all ‘io.appium.settings’ processes
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell ‘pgrep --help; echo $?’’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[ADB] Getting IDs of all ‘io.appium.settings’ processes
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[ADB] Starting Appium Settings app
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER’
[ADB] Getting IDs of all ‘io.appium.settings’ processes
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell appops set io.appium.settings android:mock_location allow’
[Logcat] Starting logs capture with command: /Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G logcat -v threadtime
[UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G forward tcp:8200 tcp:6790’
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys package io.appium.uiautomator2.server’
[ADB] ‘io.appium.uiautomator2.server’ is not installed
[ADB] App ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’ is not installed
[UiAutomator2] io.appium.uiautomator2.server installation state: notInstalled
[ADB] Checking app cert for /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk
[ADB] Using ‘apksigner.jar’ from ‘/Users/raymond/Library/Android/sdk/build-tools/34.0.0-rc1/lib/apksigner.jar’
[ADB] Starting apksigner: /Users/raymond/Library/Java/JavaVirtualMachines/openjdk-19.0.2/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/raymond/Library/Android/sdk/build-tools/34.0.0-rc1/lib/apksigner.jar verify --print-certs ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’
[ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[ADB]
[ADB] sha256 hash did match for ‘appium-uiautomator2-server-v4.24.0.apk’
[ADB] ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’ is signed with the default certificate
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys package io.appium.uiautomator2.server.test’
[ADB] ‘io.appium.uiautomator2.server.test’ is not installed
[ADB] Checking app cert for /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[ADB] Starting apksigner: /Users/raymond/Library/Java/JavaVirtualMachines/openjdk-19.0.2/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/raymond/Library/Android/sdk/build-tools/34.0.0-rc1/lib/apksigner.jar verify --print-certs ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’
[ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[ADB]
[ADB] sha256 hash did match for ‘appium-uiautomator2-server-debug-androidTest.apk’
[ADB] ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’ is signed with the default certificate
[UiAutomator2] Server packages are going to be (re)installed
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G version’
[ADB] The application at ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G install -r --no-incremental ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’’
[ADB] The installation of ‘appium-uiautomator2-server-v4.24.0.apk’ took 539ms
[ADB] Install command stdout: Performing Streamed Install
[ADB] Success
[ADB] The application at ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G install -r --no-incremental ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’’
[ADB] The installation of ‘appium-uiautomator2-server-debug-androidTest.apk’ took 419ms
[ADB] Install command stdout: Performing Streamed Install
[ADB] Success
[UiAutomator2] Waiting up to 30000ms for services to be available
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell pm list instrumentation’
[UiAutomator2] Instrumentation target ‘io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner’ is available
[ADB] Adding packages [“io.appium.settings”,“io.appium.uiautomator2.server”,“io.appium.uiautomator2.server.test”] to Doze whitelist
[ADB] Got the following command chunks to execute: [[“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.settings",";",“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.uiautomator2.server",";",“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.uiautomator2.server.test",";"]]
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;’
[UiAutomator2] No app capability. Assuming it is already on the device
[ADB] Getting install status for com.google.android.calculator
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys package com.google.android.calculator’
[ADB] ‘com.google.android.calculator’ is installed
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell am force-stop com.google.android.calculator’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell pm clear com.google.android.calculator’
[AndroidDriver] Performed fast reset on the installed ‘com.google.android.calculator’ application (stop and clear)
[UiAutomator2] Performing shallow cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (socket hang up)
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell am force-stop io.appium.uiautomator2.server.test’
[UiAutomator2] Starting UIAutomator2 server 4.24.0
[UiAutomator2] Using UIAutomator2 server from ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.0.apk’ and test from ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“QV7810JB8G”,“shell”,“am”,“instrument”,"-w","-e",“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] Got response with status 200: {“sessionId”:“None”,“value”:{“message”:“UiAutomator2 Server is ready to accept commands”,“ready”:true}}
[UiAutomator2] The initialization of the instrumentation process took 2113ms
[WD Proxy] Matched ‘/session’ to command name ‘createSession’
[WD Proxy] Proxying [POST /session] to [POST h-t-t-p://127.0.0.1:8200/wd/hub/session] with body: {“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”},“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”,“deviceUDID”:“QV7810JB8G”}],“alwaysMatch”:{}}}
[WD Proxy] Got response with status 200: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:{“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”},“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”,“deviceUDID”:“QV7810JB8G”}],“alwaysMatch”:{}},“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”}}
[WD Proxy] Determined the downstream protocol as ‘W3C’
[WD Proxy] Proxying [GET /appium/device/info] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/session/e3e507e9-03ec-467a-8c1e-f6c4e3976c74/appium/device/info] with no body
[WD Proxy] Got response with status 200: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:{“androidId”:“e570ee1725f2054a”,“apiVersion”:“30”,“bluetooth”:{“state”:“OFF”},“brand”:“Sony”,“carrierName”:"",“displayDensity”:420,“locale”:“zh_HK_#Hant”,“manufacturer”:“Sony”,“model”:“XQ-BC72”,“networks”:[{“capabilities”:{“SSID”:null,“linkDownBandwidthKbps”:352000,“linkUpstreamBandwidthKbps”:357734,“networkCapabilities”:“NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED”,“signalStrength”:-37,“transportTypes”:“TRANSPORT_WIFI”},“detailedState”:“CONNECTED”,“extraInfo”:"",“isAvailable”:true,“isConnected”:true,“isFailover”:false,“isRoaming”:false,“state”:“CONNECTED”,“subtype”:0,“subtypeName”:"",“type”:1,“typeName”:“WIFI”}],“platformVersion”:“11”,“realDisplaySize”:“1096x2560”,“timeZone”:“Asia/Hong_Kong”}}
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell dumpsys window’
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'com.google.android.calculator/com.android.calculator2.Calculator and waiting for ‘com.google.android.calculator/com.android.calculator2.Calculator’
[ADB] Running ‘/Users/raymond/Library/Android/sdk/platform-tools/adb -P 5037 -s QV7810JB8G shell am start -W -n com.google.android.calculator/com.android.calculator2.Calculator -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’
[WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/session/e3e507e9-03ec-467a-8c1e-f6c4e3976c74/appium/device/pixel_ratio] with no body
[WD Proxy] Got response with status 200: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:2.625}
[WD Proxy] Matched ‘/appium/device/system_bars’ to command name ‘getSystemBars’
[WD Proxy] Proxying [GET /appium/device/system_bars] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/session/e3e507e9-03ec-467a-8c1e-f6c4e3976c74/appium/device/system_bars] with no body
[WD Proxy] Got response with status 200: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:{“statusBar”:63}}
[WD Proxy] Matched ‘/window/current/size’ to command name ‘getWindowSize’
[WD Proxy] Proxying [GET /window/current/size] to [GET h-t-t-p://127.0.0.1:8200/wd/hub/session/e3e507e9-03ec-467a-8c1e-f6c4e3976c74/window/current/size] with no body
[WD Proxy] Got response with status 200: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:{“height”:2434,“width”:1096}}
[Appium] New AndroidUiautomator2Driver session created successfully, session f2af8635-a07f-4872-af0b-d9066b37624d added to master session list
[BaseDriver] Event ‘newSessionStarted’ logged at 1677053196711 (16:06:36 GMT+0800 (Hong Kong Standard Time))
[W3C (f2af8635)] Cached the protocol value ‘W3C’ for the new session f2af8635-a07f-4872-af0b-d9066b37624d
[W3C (f2af8635)] Responding to client with driver.createSession() result: {“capabilities”:{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”},“platformName”:“android”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.google.android.calculator”,“automationName”:“Appium”,“deviceName”:“QV7810JB8G”,“platformVersion”:“11”,“deviceUDID”:“QV7810JB8G”,“deviceApiLevel”:30,“deviceScreenSize”:“1096x2560”,“deviceScreenDensity”:420,“deviceModel”:“XQ-BC72”,“deviceManufacturer”:“Sony”,“pixelRatio”:2.625,“statBarHeight”:63,“viewportRect”:{“left”:0,“top”:63,“width”:1096,“height”:2371}}}
[h-t-t-p] <-- POST /wd/hub/session 200 14570 ms - 932
[h-t-t-p]
[h-t-t-p] --> POST /wd/hub/session/f2af8635-a07f-4872-af0b-d9066b37624d/element
[h-t-t-p] {“using”:“id”,“value”:“com.android.calculator2:id/digit_7”}
[W3C (f2af8635)] Calling AppiumDriver.findElement() with args: [“id”,“com.android.calculator2:id/digit_7”,“f2af8635-a07f-4872-af0b-d9066b37624d”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched ‘/element’ to command name ‘findElement’
[WD Proxy] Proxying [POST /element] to [POST h-t-t-p://127.0.0.1:8200/wd/hub/session/e3e507e9-03ec-467a-8c1e-f6c4e3976c74/element] with body: {“strategy”:“id”,“selector”:“com.android.calculator2:id/digit_7”,“context”:"",“multiple”:false}
[WD Proxy] Got response with status 404: {“sessionId”:“e3e507e9-03ec-467a-8c1e-f6c4e3976c74”,“value”:{“error”:“no such element”,“message”:“An element could not be located on the page using the given search parameters”,“stacktrace”:"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleh-t-t-pRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.h-t-t-p.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann…
[W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[W3C (f2af8635)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[W3C (f2af8635)] at AndroidUiautomator2Driver.findElOrEls (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-driver/lib/commands/find.js:75:11)
[W3C (f2af8635)] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[h-t-t-p] <-- POST /wd/hub/session/f2af8635-a07f-4872-af0b-d9066b37624d/element 404 633 ms - 504
[h-t-t-p]