zebrunner / carina-webdriver

Apache License 2.0
7 stars 10 forks source link

prohibit screenshot for non detected session #140

Closed vdelendik closed 1 year ago

vdelendik commented 1 year ago

there is no sense to show full stacktrace if screenshot capturing fail due to the nosuchsession exception

12:32:41  2023-08-18 10:32:41 Screenshot [TestNG-tests-14-33] [ERROR] Undefined error on capture screenshot detected!
12:32:41  org.openqa.selenium.NoSuchSessionException: Session does not exist[[[--udid 00008110-001005C11E78801E --name iPhone_13_mini --sessionId 2080b618-1842-42de-a344-2a03dc684fd7]]]
12:32:41  Build info: version: '4.7.0', revision: '0a5b49d16f'
12:32:41  System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.184-175.749.amzn2.x86_64', java.version: '17.0.7'
12:32:41  Driver info: io.appium.java_client.ios.IOSDriver
12:32:41  Command: [2080b618-1842-42de-a344-2a03dc684fd7, screenshot {}]
12:32:41  Capabilities {appium:app: https://mfp-solvd-com.s3.eu/..., appium:autoAcceptAlerts: false, appium:automationName: XCuiTest, appium:clearSystemFiles: false, appium:databaseEnabled: false, appium:deviceName: ANY, appium:deviceType: phone, appium:enableLog: true, appium:enableVideo: true, appium:fullReset: true, appium:javascriptEnabled: true, appium:language: en, appium:locale: en_US, appium:locationContextEnabled: false, appium:mjpegServerPort: 8101, appium:networkConnectionEnabled: false, appium:newCommandTimeout: 2000, appium:noReset: false, appium:platformVersion: 16.1, appium:preventWDAAttachments: true, appium:provider: mcloud, appium:simpleIsVisibleCheck: true, appium:takesScreenshot: true, appium:udid: 00008110-001005C11E78801E, appium:waitForQuiescence: false, appium:wdaLocalPort: 8100, appium:webDriverAgentUrl: http://localhost:8100/, appium:webStorageEnabled: false, platformName: IOS, server:CONFIG_UUID: f6de0b9b-afdd-451f-a8f1-7d2..., zebrunner:slotCapabilities: {adb_port: 7692, automationName: XCUITest, deviceName: iPhone_13_mini, deviceType: Phone, maxInstances: 1, platform: IOS, platformName: ios, platformVersion: 16.1, proxy_port: 7693, remoteURL: null, seleniumProtocol: WebDriver, server:CONFIG_UUID: f6de0b9b-afdd-451f-a8f1-7d2..., udid: 00008110-001005C11E78801E}}
12:32:41  Session ID: 2080b618-1842-42de-a344-2a03dc684fd7
12:32:41    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
12:32:41    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
12:32:41    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
12:32:41    at java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) ~[?:?]
12:32:41    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
12:32:41    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:262) ~[java-client-8.3.0.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:541) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:272) ~[java-client-8.3.0.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs$original$iv0cYGN2(RemoteWebDriver.java:331) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs$original$iv0cYGN2$accessor$29DmtFiU(RemoteWebDriver.java) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver$auxiliary$o5fBrM6f.call(Unknown Source) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at com.zebrunner.agent.core.webdriver.PublicMethodInvocationInterceptor.onPublicMethodInvocation(PublicMethodInvocationInterceptor.java:18) ~[agent-core-1.9.6.jar:?]
12:32:41    at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java) ~[selenium-remote-driver-4.7.0.jar:?]
12:32:41    at io.appium.java_client.AppiumDriver.getScreenshotAs(AppiumDriver.java:281) ~[java-client-8.3.0.jar:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.lambda$takeVisibleScreenshot$6(Screenshot.java:674) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208) ~[selenium-support-4.7.0.jar:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.takeVisibleScreenshot(Screenshot.java:674) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.capture(Screenshot.java:386) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.lambda$capture$2(Screenshot.java:322) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at java.util.Optional.flatMap(Unknown Source) ~[?:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.capture(Screenshot.java:322) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at com.zebrunner.carina.webdriver.Screenshot.capture(Screenshot.java:291) ~[carina-webdriver-1.1.6.P1-SNAPSHOT.jar:?]
12:32:41    at com.zebrunner.carina.core.listeners.CarinaListener.takeScreenshot(CarinaListener.java:743) ~[carina-core-1.1.4.P1-SNAPSHOT.jar:?]
12:32:41    at com.zebrunner.carina.core.listeners.CarinaListener.onTestSkipped(CarinaListener.java:360) ~[carina-core-1.1.4.P1-SNAPSHOT.jar:?]
12:32:41    at com.nordstrom.automation.testng.ListenerChain.onTestSkipped(ListenerChain.java:411) ~[testng-foundation-2.0.1.jar:?]
12:32:41    at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:90) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestInvoker.runTestResultListener(TestInvoker.java:277) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:764) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:221) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:969) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:194) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at java.util.ArrayList.forEach(Unknown Source) ~[?:?]
12:32:41    at org.testng.TestRunner.privateRun(TestRunner.java:829) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.TestRunner.run(TestRunner.java:602) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.SuiteRunner.runTest(SuiteRunner.java:437) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:475) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58) ~[testng-7.7.1.jar:7.7.1]
12:32:41    at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
12:32:41    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
12:32:41    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
12:32:41    at java.lang.Thread.run(Unknown Source) [?:?]