Testes automatizados para aplicações móveis multiplataforma - Menegassi, André Augusto (2018)
Background: Operating Systems (OSs), such Android and iOS, control modern mobile devices and are used as platform for executing a wide range of mobile apps. These apps can be cross-platform, highlighting for their ability to execute in multiple OSs. Such apps are developed using frameworks such as Apache Cordova, Xamarin and React Native. Testing this kind of apps is a challenge due to the diversity of devices and platforms available on the market. As testing the app on a single device or platform does not guarantee the correct operation on others, each device represents a configuration to be verified. However, mechanisms for automating the user interface (UI) tests are not cross-platform and do not support multiple configurations. For example, test scripts have to be written two or more times since the UI representations of each platforms are different. Objective: this master thesis aims to present an approach to generate a proper script to automate UI testing in crossplatform mobile apps. Method: to test in multiple configurations, the approach adopts two reference devices: one running Android and another iOS. Since both platforms have their own UI representation in XML, we also investigated eight strategies for locating UI elements: six individual expressions and two combined strategies. A tool called x-PATeSCO has been implemented to support the proposed approach. It is capable of generating the eight locating strategies and include them in a test project to execute in various configurations. The approach and the tool were evaluated in an experimental study with nine mobile cross-platform apps, comparing the locating strategies in six real devices. Conclusion: we measured the applicability and executability rates of locating strategies; the results gave evidence that the proposed approach and tool contribute to the UI testing of apps on various platforms. Overall, the combined strategies (ExpressionsInOrder and ExpressionsMultiLocator) obtained the best results, reaching 70.2% of the event executability and 65.5% of test cases executed successfully. When compared with known expressions employed in practice, like IdentifyAttributes and AbsolutePath, the combined strategies outperform in event executability from 8.9% to 17.6%, respectively. As for execution time, ExpressionsInOrder was approximately six times faster than ExpressionsMultiLocator.