Troubleshooting when Testing Mobile Applications

Why does the Select Application dialog not display my mobile devices?

If Silk4J does not recognize a mobile device or emulator, the Mobile tab in the Select Application dialog does not display the device or emulator. Additionally, the Web tab of the Select Application dialog does not display the mobile browsers that are installed on the device or emulator.

Silk4J might not recognize a mobile device or emulator for one of the following reasons:
Reason Solution
The emulator is not running. Start the emulator.
The Android Debug Bridge (adb) does not recognize the mobile device. To check if the mobile device is recognized by adb:
  1. Navigate to the Android Debug Bridge (adb) in the Android SDK installation folder. If the Android SDK is not installed, navigate to C:\Program Files (x86)\Silk\SilkTest\ng\Mobile\windows\AndroidTools\platform-tools to use the adb that is installed with Silk4J.
  2. Hold Shift and right-click into the File Explorer window.
  3. Select Open command window here.
  4. In the command window, type adb devices to get a list of all attached devices.
  5. If your device is not listed, check if USB-debugging is enabled on the device and if the appropriate USB driver is installed.
  6. If you get an error, for example adb server is out of date, ensure that the adb version in C:\Program Files (x86)\Silk\SilkTest\ng\Mobile\windows\AndroidTools\platform-tools is the same as the adb version of your local Android SDK. For additional information, see What can I do if the connection between the Open Agent and my device is unstable?.
The version of the operating system of the device is not supported by Silk4J. For information on the supported mobile operating system versions, refer to the Release Notes.
The USB driver for the device is not installed on the local machine. Install the USB driver for the device on the local machine. For additional information, see Installing a USB Driver.
USB-debugging is not enabled on the device. Enable USB-debugging on the device. For additional information, see Enabling USB-Debugging.
Note: If all previous solutions do not work, you could try to restart the device.

Why does Silk4J search for a URL in Chrome for Android instead of navigating to the URL?

Chrome for Android might in some cases interpret typing an URL into the address bar as a search. As a workaround you can manually add a command to your script to navigate to the URL.

What do I do if the adb server does not start correctly?

When the Android Debug Bridge (adb) server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients. All adb clients use port 5037 to communicate with the adb server. The adb server locates emulator and device instances by scanning odd-numbered ports in the range 5555 to 5585, which is the range used by emulators and devices. Adb does not allow changing those ports. If you encounter a problem while starting adb, check if one of the ports in this range is already in use by another program.

For additional information, see http://developer.android.com/tools/help/adb.html.

What can I do if the connection between the Open Agent and my device is unstable?

If you have installed the Android SDK or another tool that uses the Android Debug Bridge (adb), an additional adb server might be running in addition to the one that is used by Silk4J. If the running adb servers have different versions, the connection between the Open Agent and the device might become unstable or even break.

To avoid version mismatch errors, specify the path to the Android SDK directory by setting the environment variable SILK_ANDROID_HOME, for example to C:\Users\<user>\AppData\Local\Android\android-sdk. If the information service was running during this change, use the Windows Service Manager to restart the Silk Test information service with the updated environment variable. If the variable is not set, Silk4J uses the adb version that is shipped with Silk4J.

Why do I get the error: Failed to allocate memory: 8?

This error displays if you are trying to start up the emulator and the system cannot allocate enough memory. You can try the following:

  1. Lower the RAM size in the memory options of the emulator.
  2. Lower the RAM size of Intel HAXM. To lower the RAM size, run the IntelHaxm.exe again and choose change.
  3. Open the Task Manager and check if there is enough free memory available. If not, try to free up additional memory by closing a few programs.

Why do I get the error "Silk Test cannot start the app that you have specified" during testing on an iOS device?

This error might display for one or more of the following reasons:
Reason Solution
The iOS device is not in developer mode. You can enable the developer mode in one of the following two ways:
  • Connect the device to a Mac on which Xcode is installed, and start the app that you want to test on the device.
  • Add your provisioning profiles to the device.
    1. Open Xcode.
    2. Select Window > Devices.
    3. Right-click on the iOS device.
    4. Select Show Provisioning Profiles.
    5. Add your provisioning profiles.
You have recently updated the iOS version of the device.
  1. Open Xcode.
  2. Select Window > Devices.
  3. Wait unitl Xcode has processed the symbol files.
UI automation is not enabled on the iOS device.
  1. Select Settings > Developer.
  2. Activate Enable UI Automation.
The Web Inspector is not activated on the iOS device, while you are trying to test a mobile web application.
  1. Click Settings > Safari > Advanced.
  2. Activate the Web Inspector.
The app that you want to test was not built for the iOS version of the iOS device on which you are testing. Use Xcode to build the app for the iOS version of the device.
The Software Update dialog box is currently open on the iOS device. Close the dialog box and disable automatic software updates:
  1. Select Settings > App and iTunes Stores > AUTOMATIC DOWNLOADS.
  2. Deactivate Updates.

Why does my Android device display only the Back button in the dynamic hardware controls?

If the Android or the Android Emulator is screen-locked when you start testing, the device or Emulator might display only the button Back in the dynamic hardware controls.

To solve this issue, stop the Open Agent, restart the device, and change the device settings to no longer lock the screen.

Why does my Android device or emulator no longer display a keyboard?

To support unicode characters, Silk4J replaces the standard keyboard with a custom keyboard. When testing is finished, the original keyboard is restored. If an error occurs during testing, the custom keyboard might still be active and cannot be replaced.

To solve this issue, manually reset the keyboard under Settings > Language & input > Current Keyboard.

Why does my device not respond during testing?

If the device, emulator, or Simulator is screen-locked when you start testing, and Silk4J is unable to unlock the screen, the device, emulator, or Simulator might stop responding to any actions.

To solve this issue, stop the Open Agent and change the device settings to no longer lock the screen.

Why can I not install the Information Service on a Mac?

When the Allow apps downloaded from setting in the General tab of the Security & Privacy system preferences pane is set to Mac App Store and identified developers, which is the default value, the following error message appears when opening the Information Service setup:
"SilkTestInformationService<version>.pkg" can't be opened because it is from an unidentified developer.
To solve this issue, use one of the following:
  • Right-click the setup file and select Open. A warning message will appear, but you will still be able to open the file.
  • Set the Allow apps downloaded from setting to Anywhere.
  • After attempting to open the file, navigate to the General tab of the Security & Privacy system preferences pane and click Open Anyway.

Why is the Recording window black when recording an Android app?

Android apps that require a higher level of security, for example apps that handle financial transactions, might have the FLAG_SECURE flag set, which prevents Silk4J from capturing the app. Silk4J relies on screenshots or on a video of the Android device during recording and will display a black screen of the device in the Recording window, if the Android app that you are testing has this flag set. To test such an app with Silk Test, you have to contact the app development team, and ask them to un-set the FLAG_SECURE flag during testing.

Why does Silk4J not show a video when testing on an Android emulator?

If the emulator is using the graphic card of your computer for better rendering, the video capturing of Silk4J might not work. To solve this, emulate the graphics in software:
  1. Open the Android Virtual Device Manager.
  2. Click Edit in the Actions column of the emulator.
  3. Select Software from the list in the Emulated Performance area of the Virtual Device Configuration dialog.

What can I do if Silk4J does not show a video when testing in a cloud environment?

When testing in a cloud environment, showing a video might not work when recording or replaying a test, for example because required ports are not open.

To solve this issue, you can specify a list of WebDriver host URLs in the infoservice.properties file. For information on how to access this properties file, see Editing the Properties of the Silk Test Information Service. Add the option infoservice.disableScreencastHosts to the file, by typing the following:
infoservice.disableScreencastHosts=<URL_1>,<URL_2>, ...
For example:
infoservice.disableScreencastHosts=http://my-webdriver-server-url.com:80/wd/hub
You can specify URL patterns like *my-webdriver-server-url.com by using asterisks (*) as wildcards.

Silk4J will show a series of screenshots instead of a video when recording and replaying on the specified hosts.

How can I change the installed version of Xcode?

If the version of Xcode that you are using is not supported by Silk4J, for example when you upgrade to the latest version of Xcode, an error message might appear when testing on iOS.

To replace the installed version of Xcode with a supported version, download a supported Xcode version from https://developer.apple.com/download/more/, and replace the unsupported version with the downloaded version. For information about the supported Xcode versions, refer to the Release Notes.

What can I do if my Mac runs out of disk space?

Silk4J uses Instruments to automate iOS devices. This tool creates large log files in the /Library/Caches/com.apple.dt.instruments directory, which might fill up disk space on the Mac. To solve this issue, Micro Focus recommends regularly deleting these log files, either manually or by using a cronjob. For example, to delete the files each day at the same time, you could do the following:
  1. Type sudo crontab -e into a Terminal. This opens an editor in which you can edit the crontab for root.
  2. Add the following line to the crontab:
    0 2 1 * * find /Library/Caches/com.apple.dt.instruments -mtime +10 -delete
  3. Save the crontab.

In this example, all log files that are older than ten days will be deleted each day at 2 AM from the directory.

Why does my test fail with the error message "Unable to sign WebDriver Agent for testing "?

When testing on a physical iOS device, this error usually means that during the build process the WebDriverAgent app could not be signed or that there is a problem with the provisioning profile.

You can check the actual problem with the following commands, which have to be executed at the Mac machine to which the device is connected:
cd /Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test
Verify that the folder Resources exists under /Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver and that the folder contains the file WebDriverAgent.bundle. If not, create this folder and an empty WebDriverAgent.bundle file, for example by using the following command:
mkdir -p Resources/WebDriverAgent.bundle

What can I do to prevent the Developer Tools Access from requesting to take control of another process?

When starting the execution of a test on iOS, a message box stating the following might appear:
Developer Tools Access needs to take control of another process for debugging to continue. Type your password to allow this.
To avoid getting this message, execute the following command in a Terminal:
sudo /usr/sbin/DevToolsSecurity --enable

Why are the rectangles wrong while testing a mobile web application on an iPad?

If the rectangles around controls are offset when testing a mobile web application on an iPad, you might have multiple browser tabs open and the Tab bar might be displayed. To fix this issue, close all tabs except one.

Why can I no longer record or replay tests on my device after updating Silk4J?

When updating to a new version of Silk4J, some Appium apps on any physical mobile devices that have already been used for mobile testing with the previous version of Silk4J are updated automatically. If for any reason these apps are not automatically updated, you might experience difficulties when trying to record or replay tests on the device.

If you are experiencing such issues on a specific Android device after updating Silk4J, manually uninstall the following apps from the device:
  • Appium Android Input Manager
  • Appium Settings
  • io.appium.uiautomator2.server
  • io.appium.uiautomator2.server.test
  • Unlock

If you are experiencing such issues on a specific iOS device after updating Silk4J, manually uninstall the WebDriverAgentRunner from the device.

Why can I not record a mobile application?

Silk4J uses Appium to test mobile applications. Some network proxy settings set in Appium might interfere with recording Silk4J. You could try to deactivate the network proxy settings on the mobile device or Emulator.

Why can I not test on my Android device?

Some Android devices might have additional settings that prevent Silk4J from testing mobile applications on the device. For example, the Xiaomi Mi Mix 2 has the same prerequisites for testing as every other device, but these are not enough. To prepare the Xiaomi Mi Mix 2 for testing, perform the following actions:
  1. Enable the developer mode on the device.
  2. Navigate to Settings > Additional settings > Developer options.
  3. Enable USB debugging.
  4. Enable Stay awake.
  5. Enable Install via USB.
  6. Enable USB debugging (Security settings).
  7. Disable Turn on MIUI optimizations.