Network Logs
Appelium supports rich network log capturing. This includes structured request and response information like:
- Headers
- Payload
- Duration
- Status codes
Automatic network requests capturing
By default, logging is automatically enabled for all network requests which use URLSession.shared, URLSessionConfiguration.default and URLSessionConfiguration.ephemeral configuration.
If you wish to enable network logging for any other/custom session configuration you can simply call:
AppeliumFeedback.enableLogging(for: mySessionConfiguration)
Tip
If you are already printing network requests information to the console using NSLog or print statements, you may wish to disable it in order to not to have duplicate logs.
Enable filtering and obfuscation
You can enable custom request filters or implement full obfuscation in case you wish to hide or prevent sensitive information from even getting logged. You can enable this using:
AppeliumFeedback.networkRequestObfuscationHandler = self
And then implement NetworkRequestObfuscationHandler protocol:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Manual request logging
In case you are not using the standard URLSession or you want to capture requests that are not automatically captured, Appelium provides you with APIs that will allow you to manually log HTTP requests:
1 2 3 4 5 6 7 8 9 10 11 12 | |
or in case of an error:
AppeliumFeedback.logRequestError(token: token, error: error)