zebrunner / carina

Carina automation framework (TestNG): Web, Mobile, API, DB etc testing...
https://zebrunner.github.io/carina
Apache License 2.0
954 stars 218 forks source link

NPE in logEntries for negative use-case #967

Closed vdelendik closed 4 years ago

vdelendik commented 4 years ago

Describe the bug When we can't collect driver logs from Appium we see NPE:

2020-04-11 13:17:34 IDriverPool [TestNG-test=Mobile test-1-26] [INFO] [Android SDK built for x86] Getting log artifact: server 2020-04-11 13:17:34 IDriverPool [TestNG-test=Mobile test-1-26] [ERROR] [Android SDK built for x86] Unrecorgnized error durig driver log populating! org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Potentially insecure feature 'get_server_logs' has not been enabled. If you want to enable this feature and accept the security ramifications, please do so by following the documented instructions at https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/security.md Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'jenkins-slave-5dm0w', ip: '100.96.103.54', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.0-11-amd64', java.version: '1.8.0_212' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {STF_ENABLED: false, adbExecTimeout: 270000, androidInstallTimeout: 270000, androidNaturalOrientation: true, app: https://qaprosoft.s3-us-wes..., appPackage: com.solvd.carinademoapplica..., appWaitDuration: 270000, autoGrantPermissions: true, automationName: UiAutomator2, carinaTestRunId: 5c062d28-4c1c-48f7-a31f-025..., databaseEnabled: false, desired: {STF_ENABLED: false, adbExecTimeout: 270000, androidInstallTimeout: 270000, androidNaturalOrientation: true, app: https://qaprosoft.s3-us-wes..., appWaitDuration: 270000, autoGrantPermissions: true, automationName: UiAutomator2, carinaTestRunId: 5c062d28-4c1c-48f7-a31f-025..., deviceName: android, enableVNC: true, enableVideo: true, language: en, locale: US, newCommandTimeout: 180, noReset: true, noSign: true, platformName: android, platformVersion: 9.0, provider: mcloud, skin: WXGA720, udid: emulator-5554, uiautomator2ServerInstallTimeout: 30000, uiautomator2ServerLaunchTimeout: 30000}, deviceApiLevel: 27, deviceManufacturer: Google, deviceModel: Android SDK built for x86, deviceName: emulator-5554, deviceScreenDensity: 320, deviceScreenSize: 720x1280, deviceUDID: emulator-5554, enableVNC: true, enableVideo: true, javascriptEnabled: true, language: en, locale: US, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 180, noReset: true, noSign: true, pixelRatio: 2, platform: LINUX, platformName: ANDROID, platformVersion: 8.1.0, provider: mcloud, skin: WXGA720, statBarHeight: 48, takesScreenshot: true, udid: emulator-5554, uiautomator2ServerInstallTimeout: 30000, uiautomator2ServerLaunchTimeout: 30000, viewportRect: {height: 1136, left: 0, top: 48, width: 720}, warnings: {}, webStorageEnabled: false} Session ID: android-8-1-d811de08-ba58-455c-a5e0-1d263db602fb at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 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 com.qaprosoft.carina.core.foundation.webdriver.listener.EventFiringAppiumCommandExecutor.execute(EventFiringAppiumCommandExecutor.java:151) 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.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35) at org.openqa.selenium.remote.RemoteLogs.getRemoteEntries(RemoteLogs.java:81) at org.openqa.selenium.remote.RemoteLogs.get(RemoteLogs.java:77) at com.qaprosoft.carina.core.foundation.webdriver.IDriverPool.getDriverLogs(IDriverPool.java:444) at com.qaprosoft.carina.core.foundation.webdriver.IDriverPool.quitDriver(IDriverPool.java:338) at com.qaprosoft.carina.core.foundation.webdriver.IDriverPool.quitDrivers(IDriverPool.java:300) at com.qaprosoft.carina.core.foundation.listeners.CarinaListener.onTestFinish(CarinaListener.java:384) at com.qaprosoft.carina.core.foundation.listeners.CarinaListener.onTestSuccess(CarinaListener.java:331) at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:70) at org.testng.internal.TestInvoker.runTestResultListener(TestInvoker.java:219) at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:651) at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173) at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:816) at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

vdelendik commented 4 years ago

https://github.com/qaprosoft/carina/commit/c1dfa0461a160e5a1aa05e2195b4d31142b9a622