SeeTestAutomation- Failure to Get Dump
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Failure to get dump
Continuous Testing Cloud may fail to identify elements or be unable to fetch the dump on a page that contains a very large number of elements.
In order to resolve this issue, you can use one of the following methods:
-
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.
Set Dump Parameters
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 in a project specific session (Project Specific Session Properties), add the following property:
Property Name | Property Value |
---|---|
ios.non-instrumented.dump.parameters | <``depth``>,<``total``>,<``children``> |
For example:
Property Name | Property Value |
---|---|
ios.non-instrumented.dump.parameters | 20,1000,50 |
You can use this property in run-time for specific tests by using the setProperty() command For example:
client.setProperty("ios.non-instrumented.dump.parameters", "20,1000,50");
to disable the property use the same command with an empty string:
client.setProperty("ios.non-instrumented.dump.parameters", "");
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 in a project specific session (Project Specific Session Properties), add the following property:
Property Name | Property Value |
---|---|
ios.dump.uielements.only.params | <true/false> |
The value will set fetch.web.anchor
to true or false. when true it will collect few extra non-UIElements to be able to identify web elements.
For example:
Property Name | Property Value |
---|---|
ios.dump.uielements.only.params | true |
Please notice that this property will effect all applications.
You can use this property in run-time for specific tests by using the setProperty() command For example:
client.setProperty("ios.dump.uielements.only.params", "true");
to disable the property use the same command with an empty string:
client.setProperty("ios.dump.uielements.only.params", "");
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 in a project specific session (Project Specific Session Properties), add the following property:
Property Name | Property Value |
---|---|
ios.dump.grid.sampling.params | <SamplesX>,<SamplesY>,<Depth>,<Hybrid(optional)>,<FrontMostAppFocused(optional)>,<traverseToRoot(optional)> |
For example:
Property Name | Property Value |
---|---|
ios.dump.grid.sampling.params | 5,12,5,true,false,true |
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.
Please notice that this property will effect all applications.
You can use this property in run-time for specific tests by using the setProperty() command For example:
client.setProperty("ios.dump.grid.sampling.params", "5,12,5,true,false,true");
to disable the property use the same command with an empty string:
client.setProperty("ios.dump.grid.sampling.params", "");
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.