Feedback and crash reports are two special features offered by Test Studio allowing the application's managers and developers to be continuously informed about users' opinions, suggested enhancements, and confronted problems. Using the deployed version of Test Studio on the simulator, we will see how to invoke these features on the Switchy application.
For this section, we will need to configure the default target e-mails for the described features. The steps are as follows:
So what did you think of Switchy?
"The application code design is pretty neat! The UI displays nicely on my iPhone and the colors are cool, but I prefer to see the switches ordered by width!"
Hmmm, why not send that to the developer. On the Test Studio main menu, choose the Feedback option. The next view has three available options as shown in the following screenshot:
Switchy comes under the native iOS application, so choose Native App. Had it not been compiled with the Test Studio extension library, we would have chosen the One Time option, which allows sending a general feedback about a native or web application that was registered with the allow anonymous feedback option checked to true.
It is time to assign the target application, so choose Switchy. After that, the application launches where a feedback toolbar is appended at the bottom as shown in the following screenshot:
To create a message, follow these steps:
Notice that the composed message did not leave your local machine yet. It is rather saved in your outbox along with other feedback messages that might have been created during the same session. This way you have the flexibility to delete some messages after clicking on the Edit button, or perhaps edit their content by clicking on the feedback message disclosure arrow. The following screenshot shows an example of two feedback messages:
There are two ways to inform the application developer with the messages and they are reflected in the two buttons Email and Upload.
The e-mailing option consists of combining all the current feedback messages and sending them to the e-mail address specified in the Test Studio's settings.
The uploading option actually pushes the feedback messages to the web portal. In order to be able to use this option, the Web Portal settings must be configured and Switchy must also be a registered application. Once completed, the uploaded feedback messages will appear in the web portal under the Feedback menu option.
Here, we are concerned with unhandled errors that occur while Test Studio is running your application. After a crash occurs, a pop-up window will prompt you, whether you want to send a report to the concerned parties as follows:
If confirmed, an e-mail interface will be launched having the error details inside the message body. In addition, the To field will be automatically populated based on the options specified in Settings. Hence, if a default e-mail exists in the Crash Reports section, this e-mail address will be directly added. So is the case for the Telerik e-mail which is also configurable as we have seen.
Sending crash reports does not have to be left up to the user's decision. This information can be acquired implicitly from the crashed application without any user intervention. This is achieved by embedding calls to the TSReport
iOS library found in the Test Studio file bundle, which hosts services for crashes and user feedback. In order to employ these services a few steps are required at three levels, which are as follows:
The web portal configuration for the crash reports requires the application to be registered as a reporting application.
The application configuration requires two steps in addition to the deployment setup procedures carried out at the beginning of this chapter:
$(SRCROOT)/TestStudioExtension/Headers
, and make sure that the TestStudioExtension
folder exists under the solution's root folder.libTestStudioReporting.a
library found under the iOS
folder of the Test Studio's extension file bundle folder downloaded earlier.Finally, the code implementation consists of the following steps:
AppDelegate.m
file from XCode and add this line of code in the Import section in order to add a reference to the Test Studio's reporting class: #import <TestStudioReporting/TestStudioReporting.h>
application:didFinishLaunchingWithOptions:
method.return
statement:[TSReport setupWithAPIKey:@"API_KEY" appId:@"APP_ID"];
setupWithAPIKey
method.setupWithAPIKey
method:NSError *error = nil; If (![TSReport installCrashHandlerWithMode:TSCrashHandlerModeSilent error:&error]) { NSLog(@"This is an automatically sent error: %@", error.localizedDescription); }
The first parameter for installCrashHandlerWithMode
is the method called TSCrashHandlerModeSilent
, which offers the capability of sending crash reports implicitly whenever they occur without the user's intervention. Instead, you can choose TSCrashHandlerModePrompt
to imitate the regular behavior explained earlier, which consists of asking the user's consent to submit the crash report.
18.216.77.153