Failure To Get Dump
In some scenarios in full control mode, Continuous Testing Cloud may fail to perform actions (for example, open object-spy) on a page that contains a very large number of elements.
In order to resolve this issue, can use one of the following methods:
-
Node-based dump (recommended).
-
Set dump parameters.
-
Dump by UIElements only.
-
Dump by grid sampling.
As of iOS 12, the use of UIWebView for web elements is deprecated (https://developer.apple.com/documentation/uikit/uiwebview.) As of iOS 14, it is no longer supported. For a suitable alternative to handle your application’s web content, see https://developer.apple.com/documentation/webkit/replacing_uiwebview_in_your_app.
When building an application using Xcode, the best practice is to make sure that the Xcode version includes the relevant iOS SDK. If not, Xcode should be upgraded to a later version that does support the relevant iOS SDK and the application re-built. Otherwise, there could be dump misalignment**.** To see Xcode compatibility information, see XCode Requirements for iOS Devices.
In iOS 15.x, installing and launching multiple instrumented apps might cause a failure to get dump. To resolve this issue, close all running applications on the device. You can do this by running CloseAllApplications.
Node-Based Dump
This ability should be configured per application using its bundle identifier.
To configure that ability:
-
Open ios_dump.properties (see app.properties).
-
Add this line:
<bundle identifier>=ios.non-instrumented.dump.node-based.bundle
For example, for an application with the bundle identifier com.experitest.eribank, add the line: com.experitest.eribank=ios.non-instrumented.dump.node-based.bundle.
-
Restart Continuous Testing Cloud.
Deleting the line from ios_dump.properties restores the default dump on the application.
By default, the Safari application bundle identifier is found in the "ios_dump.properties" file.
Set Dump Parameters
If the node-based dump method does not work, use this method to define specific dump parameters to limit the element's numbers.
There are these dump parameters:
-
Depth - Depth of the element hierarchy tree.
-
Total - Total amount of elements in the dump.
-
Children -Max node's successors (children) for each element (node).
To use this method, add to app.property the property:
ios.non-instrumented.dump.parameters= <depth>,<total>,<children>
For example: ios.non-instrumented.dump.parameters=20,1000,50
. You can use this property in run-time for specific tests by using the command setProperty() with the property ios.non-instrumented.dump.parameters
. For example: client.setProperty("ios.non-instrumented.dump.parameters", "20,1000,50")
.
Dump by UIElements Only
You can create a dump by collecting native UI elements. This can help to avoid crashes in the case of a large web dump.
To use this method, add to app.properties the following properties:
-
For a specific application:
ios.dump.uielements.only_<bundleId>=<fetch.web.anchor=true/false>
-
For all applications:
ios.dump.uielements.only.params=<fetch.web.anchor=true/false>
-
fetch.web.anchor
- When set to true, collect few extra non-UIElements to be able to identify web elements.
Node-Based Dump
Configure this per application using its bundle identifier.
To configure this ability:
-
In app.property. open the "ios_dump.properties".
-
Add this line:
info<bundle identifier>=ios.non-instrumented.dump.node-based.bundle
For example, for an application with bundle identifier 'com.experitest.eribank' add this line:
infocom.experitest.eribank=ios.non-instrumented.dump.node-based.bundle
-
Restart the test.
If you delete the line from ios_dump.properties
, the default dump on the application is used.
By default, Safari application bundle identifier is found at the "ios_dump.properties" file.
Dump by Grid Sampling
You can create a dump by sampling grid of points. SamplesX refers to how many samples on X-Axis when a device is in portrait orientation when in Landscape the samples on each axis will switch. The best practice is to first try the default values which ARE 5,12,5,true,false,true. If this does not create the expected dump, then try other values. To use this method add to app.properties the following property:
ios.dump.grid.sampling_<bundleId>=<SamplesX>,<SamplesY>,<Depth>,<Hybrid(optional)>,<FrontMostAppFocused(optional)>,<traverseToRoot(optional)>
Optional Parameters
-
Hybrid: Combines the grid sampling and the traditional dump method, which can improve performance.
-
FrontMostAppFocused: Ignore results from elements that belong to other pids, such widgets, _UIRemoteView elements, and other apps.
-
traverseToRoot: default value is true.
If True, it traverses to the root node and then starts discovery down-to sampled node + depth.
If False, the discovery starts from sampled node.
Web Dump Limitations
In order to retrieve web dump from a hybrid app in non-instrumented mode, it must be distributed for Development or for Ad hoc with the get-task-allow entitlement set to true.
You can't retrieve a web dump for an app that is distributed for Enterprise and is installed in non-instrumented mode.
SwiftUI Instrumented Dump Depth
In SwiftUI instrumented applications, you can limit the depth of the dump, which in some cases, is used to fill the properties of the elements. The default value is 10. It's recommended to try whenever there is a page where trying to fetch the dump causes the application to crash. Setting this affects all connected iOS devices.
To do this:
- Add
instrumentation.dump.max.depth
to the Cloud agentapplication.properties
file. - Restart the agent.