Unable to capture objects : Web Driver Exception

I am using Katalon V5.6.3

Appium Version 1.7.2
Android SDK: 28.0.2

Able to Connect the device; before splash screen i am getting “Unable to capture objects : Web Driver Exception”. below are the message that i am getting in details:

"An unknown server-side error occurred while processing the command. Original error: Cannot get screenshot data because of ‘The size of the taken screenshot equals to zero.’. Make sure the ‘LayoutParams.FLAG_SECURE’ is not set for the current view (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINJITLAPTOP96’, ip: ‘192.168.0.176’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_181’

Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver

Capabilities {app: C:\Users\deepakv\Downloads\…, autoGrantPermissions: true, automationName: uiautomator2, deviceName: motorola XT1635-02 (Android…, fullReset: false, javascriptEnabled: true, newCommandTimeout: 1800, noReset: true, platform: ANDROID, platformName: ANDROID, udid: ZY223PWMFH}

Session ID: 4b52200c-7735-472f-9d55-8149a5444459"

Also below is the log file for same:

[Appium] Welcome to Appium v1.7.2 (REV bade6dc09ad45a6e3db08819a7fe0f047b572e01)

[Appium] Non-default server args:

[Appium] port: 42872

[Appium] loglevel: info

[Appium] chromeDriverPort: 42873

[Appium] tmpDir: C:\Users\deepakv\AppData\Local\Temp\\Katalon\Appium\Temp1536067959023

[Appium] Appium REST http interface listener started on 0.0.0.0:42872

[HTTP] → GET /wd/hub/status {}

[HTTP] ← GET /wd/hub/status 200 113 ms - 110

[HTTP] → GET /wd/hub/status {}

[HTTP] ← GET /wd/hub/status 200 105 ms - 110

[HTTP] → POST /wd/hub/session {“desiredCapabilities”:{“app”:“C:\\Users\\deepakv\\Downloads\\DCB_V1.0.0.6.apk”,“autoGrantPermissions”:true,“automationName”:“uiautomator2”,“deviceName”:“motorola XT1635-02 (Android 8.0.0)”,“fullReset”:false,“newCommandTimeout”:1800,“noReset”:true,“platform”:“ANDROID”,“platformName”:“Android”,“udid”:“ZY223PWMFH”},“capabilities”:{“desiredCapabilities”:{“app”:“C:\\Users\\deepakv\\Downloads\\DCB_V1.0.0.6.apk”,“autoGrantPermissions”:true,“automationName”:“uiautomator2”,“deviceName”:“motorola XT1635-02 (Android 8.0.0)”,“fullReset”:false,“newCommandTimeout”:1800,“noReset”:true,“platform”:“ANDROID”,“platformName”:“Android”,“udid”:“ZY223PWMFH”},“firstMatch”:[{“platformName”:“android”}]}}

[Appium] Merged W3C capabilities {“desiredCapabilities”:{“app”:"C:\\Users\\deepa… into desiredCapabilities object {“app”:"C:\\Users\\deepakv\\Downloads\\DCB_V1.0…

[Appium] Creating new AndroidUiautomator2Driver (v0.11.0) session

[Appium] Capabilities:

[Appium] app: C:\Users\deepakv\Downloads\DCB_V1.0.0.6.apk

[Appium] autoGrantPermissions: true

[Appium] automationName: uiautomator2

[Appium] deviceName: motorola XT1635-02 (Android 8.0.0)

[Appium] fullReset: false

[Appium] newCommandTimeout: 1800

[Appium] noReset: true

[Appium] platform: ANDROID

[Appium] platformName: android

[Appium] udid: ZY223PWMFH

[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.

[BaseDriver] Session created with session id: 4b52200c-7735-472f-9d55-8149a5444459

[BaseDriver] Using local app ‘C:\Users\deepakv\Downloads\DCB_V1.0.0.6.apk’

[AndroidDriver] Java version is: 1.8.0_181

[ADB] Checking whether adb is present

[ADB] Using adb.exe from C:\Users\deepakv\.katalon\tools\android_sdk\platform-tools\adb.exe

[AndroidDriver] Retrieving device list

[AndroidDriver] Using device: ZY223PWMFH

[ADB] Checking whether adb is present

[ADB] Checking whether aapt is present

[ADB] Using aapt.exe from C:\Users\deepakv\.katalon\tools\android_sdk\build-tools\28.0.2\aapt.exe

[ADB] Extracting package and launch activity from manifest

[ADB] Getting device platform version

[ADB] Checking whether aapt is present

[AndroidDriver] setDeviceLanguageCountry requires language or country.

[AndroidDriver] Got language: ‘null’ and country: ‘null’

[ADB] Checking whether aapt is present

[ADB] Checking whether aapt is present

[AndroidDriver] Using app unlock, this is going to be deprecated!

[AndroidDriver] Unlocking screen

[ADB] Using apksigner.bat from C:\Users\deepakv\.katalon\tools\android_sdk\build-tools\28.0.2\apksigner.bat

[AndroidDriver] Remote apk path is /data/local/tmp/e009338eb7e73ab8b7832ec838cdf75e.apk

[ADB] Checking whether aapt is present

[ADB] Extracting package and launch activity from manifest

[ADB] com.dcb contains no permissions available for granting.

[UiAutomator2] Starting uiautomator2 server v0.3.0

[UiAutomator2] Running command: ‘adb -s ZY223PWMFH shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner’

[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online…

[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.dcb/com.dcb.prelogin.splash.activity.SplashActivity’. Starting it ourselves

[Appium] New AndroidUiautomator2Driver session created successfully, session 4b52200c-7735-472f-9d55-8149a5444459 added to master session list

[HTTP] ← POST /wd/hub/session 200 95558 ms - 363

[HTTP] → GET /wd/hub/status {}

[HTTP] ← GET /wd/hub/status 200 114 ms - 121

[HTTP] → POST /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/timeouts {“type”:“implicit”,“ms”:60000}

[HTTP] ← POST /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/timeouts 200 11 ms - 76

[HTTP] → GET /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/source {}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[JSONWP Proxy] Replacing sessionId ee44f340-bf10-4753-9ca6-15ca3f45d005 with 4b52200c-7735-472f-9d55-8149a5444459

[HTTP] ← GET /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/source 200 3147 ms - 20515

[HTTP] → GET /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/screenshot {}

[AndroidDriver] Cannot get screenshot data with ‘adb exec-out’ because of ‘Screenshot returned no data’. Defaulting to ‘adb shell’ call

[HTTP] ← GET /wd/hub/session/4b52200c-7735-472f-9d55-8149a5444459/screenshot 500 745 ms - 333

Hi @deepak_verma,

Following up on this issue. The error you’re seeing:

Cannot get screenshot data because of ‘The size of the taken screenshot equals to zero.’. Make sure the ‘LayoutParams.FLAG_SECURE’ is not set for the current view

Is because Android allows developers to mark certain screens as “secure” so that they can’t have screenshots taken of them. This is usually done for login, credit card, or other sensitive data screens. Because the Katalon Studio Test Recorder and Mobile Spy work off of screenshots, you’ll get this error.

Capturing of the test objects should still work, however, you just won’t be able to see the screenshot to get a preview of the screen element you’re selecting.

Hope this helps,

Chris

@Chris_Trevarthen Are you sure you should be able to capture test objects even when a TakeScreenshotException occurs?

With Katalon Studio 6.x this is not possible. I get a TakeScreenshotException but no test object capture. How should I capture test objects in an Android screen which is probably secured using the secure flag?

Hi @mdmmzm,

I’m currently using Katalon Studio 6.0.5 with Appium 1.8.2-beta (this is for iOS 12 support, so if you’re only testing Android, Appium 1.8.1 should work).

When I try to use the Spy Mobile on a screen that is marked as secure, I get the error message below. Clicking the “Details” button shows that the screen is probably secure:

If you click “OK”, the error dialog goes away.

You won’t be able to see the preview of the screen in the Device View window, but you can still capture objects in the Mobile Object Spy window. You’ll need to rely on the name/label of the object to be able to know what you’re capturing, but you will still be able to capture the object by clicking the checkbox to the left of it.

Hope this helps,

Chris

1 Like

@Chris_Trevarthen

Thank you. This helps for capturing the test objects.

Now I have a problem setting a value on the captured testobjects. Type of objects when captured is “ImageView”. It is not possible to execute “setText” or “sendKeys” on this type of objects. Even after “tapping” on it I cannot set text. Usually you can only set value on an input object like EditText. But this ImageView seems not to transform into an input object after tapping it.

How can I set the value on a testobject on a secure page?

PS: it is not possible to unset the “secure” flag because it is an external closed-source app.

Captured objects of type ImageView:
49

The secret page with pin input (6 seperate fields)

Hi @mdmmzm,

Thanks for the screenshot and explanation, that’s helpful. You’re correct that you can only set text on text fields, and not images.

I’m thinking that if we can get the keyboard to come up at least, we can access the keys. When you are using the app normally (not testing) how do you get the keyboard to come up so that you can enter the PIN? Do you have to tap one of the circles first? I think we can make the test do the same thing.

Once the keyboard is up, you could try pressing the keys on the keypad like this post mentions:

Hope this helps,

Chris

Hi @Chris_Trevarthen ,
Yes this works! Thank you.
A standard keyword would be helpful for typing via keyboard as you are gonna need it more than one time.

1 Like

Hi @Chris_Trevarthen

I have created a Gist for this purpose: Keyboard.groovy: Fill out numbers using Android Keyboard

1 Like

Hi, I have the same mistake, can you resolve it? .

Hi @ariel.villalobos,

Can you share what version of Katalon Studio and Appium you’re using? Could you also share any screenshots or logs from Katalon you are seeing?

—Chris

Hi Chris:

I got the information:

Katalon Studio
Version: 6.3.2
Build: 4

appium --version : 1.14.1

Hi @ariel.villalobos,

As far as I know, Appium 1.12.1 is the latest supported version. Could you try downgrading to that version and see if that helps?

npm install -g appium@1.12.1

Hope this helps,

Chris

1 Like

thank you very much!

Hi @Chris_Trevarthen , im getting the same issue. but i cant dismiss the “Capturing Information” message.

So, i cant capture the rest of the objects.

Any idea how to solve this problem?

Thanks!

Hi @Gaston_Marichal,

Can you provide a little more info about the versions of Katalon Studio, Appium, and Android SDK you’re using? Are you capturing on a real device or an emulator? Can you tell me the Android version of on the device?

Thanks,

Chris

Yeah, sure!
Katalon Studio: 6.3.3 build 11
Android-SDK: 27
Appium: V 1.15.0

I tried with both device type, (Real and Emulator) Running Android 9

Thanks for your help!

Hi @Gaston_Marichal,

As far as I know, Appium 1.12.1 is the latest supported version. Could you try downgrading to that version and see if that helps?

npm install -g appium@1.12.1

Hope this helps,

Chris

Hello Chris, I downgrade to v 1.12.1 and it seems to work

Thank for your help!

Hi All,

I am very new to Katalon, at mobile testing I am getting below error

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.sap.fsm' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.coresuite.android.AppStartActivity' or 'com.sap.fsm.com.coresuite.android.AppStartActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'INLN50939184A', ip: '10.136.226.154', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: SwipeableAndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.sap.fsm' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.coresuite.android.AppStartActivity' or 'com.sap.fsm.com.coresuite.android.AppStartActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting at getResponseForW3CError (C:\Users\I3540\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9) at asyncHandler (C:\Users\I354\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'INLN50939184A', ip: '10.136.226.154', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: SwipeableAndroidDriver at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:49) at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12.run(MobileLocalAppComposite.java:474) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119) Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.sap.fsm' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.coresuite.android.AppStartActivity' or 'com.sap.fsm.com.coresuite.android.AppStartActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'INL', ip: '10.136.226.154', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: SwipeableAndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.sap.fsm' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.coresuite.android.AppStartActivity' or 'com.sap.fsm.com.coresuite.android.AppStartActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting at getResponseForW3CError (C:\Users\I354008\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9) at asyncHandler (C:\Users\I354008\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'INLN50939184A', ip: '10.136.226.154', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: SwipeableAndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217) 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:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:85) at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.<init>(SwipeableAndroidDriver.java:24) at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:497) at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:479) at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:458)

and when I select Application ID instead of file it throws unable to capture objects reason screenshot exception. Please help me.

Thanks,
Raja

@Chris_Trevarthen,

I am not able to capture the object during the mobile test recording.On Clicking the ‘Capture object’ option not loading the objects.
Katalon Version : 7.1.0
appium version: 1.15.1
Android SDK : 29

Whether downgrading any of the above will solve the problem ?