Prior to testing a Hybrid Application on Android using Silk Test you need to ensure that the follow prerequisites listed below have been met. Failure to meet these requisites will result in Silk Test being unable to recognise individual hybrid controls within your Android Application
- Ensure that Java is installed on the machine on which Silk Test is running, and that the path to Java is added to the Path environment variable. Silk Test requires either a JRE or a JDK for mobile testing. If Java is not installed, add C:\Program Files (x86)\Silk\SilkTest\ng\jre\bin to the Path.
- If you have created your own hybrid app by adding a web view to a native mobile app, add the following code to the app to make your app testable with Silk Test Classic:
WebView.setWebContentsDebuggingEnabled(true);
WebView.getSettings().setJavaScriptEnabled(true);
To ascertain if you have correctly met the above requisites particularly regarding enable JavaScript and WebContents debugging you can use the Google Chrome Development Tool. To do this:
1) Enable USB debugging on your Android device
On your Android device, open up Settings, find the Developer options section, and enable USB debugging. If you're running Android 4.2 or later and you can't find Developer options you may need to enable it
2) Connect and discover your Android device
On your development machine, open Chrome. You should be logged in to one of your user profiles. Remote debugging does not work in incognito or guest mode.
Ensure that the Hybrid Application is opened on the device, then from Chrome “Open DevTools and select More tools > Inspect devices”
3) Debug content on Android device from development machine
From the Inspect Devices dialog, select your device from the menu on the left.
In the image below, you can see that the inspect tool is unable to inspect any Hybrid elements
Whilst in contrast the image below, shows that you the inspect tool is able to inspect Hybrid elements. Therefore validating that the application has met the perquisites listed in the Silk Test Help.