Mobile Automation Stories — XCUITest — 1

Mesut Beysülen
4 min readDec 5, 2022

--

This is a cover letter for an ios mobile application automation. Happy reading…

Introduction

In my previous articles, I wrote a series of how you can perform a mobile application automation process with appium. However, research has been done to develop an automation project that can be an appium alternative and to advance it in parallel. And as a result, the situation “to be able to develop faster automation projects with XCUITest, to eliminate both the slowness and instability experienced with the convenience of xcode and the appium” became interesting. Also, it is interesting to create a “MockServer” in itself and to produce faster solutions for tests. I saw that it could be good. But your loss here is primarily “run it on 2 platforms with one code.” It is necessary to pay attention to the loss of such features. Of course, the priority of the project, the suitability of the project and the calculation of the cost as effort should be reasonable. Otherwise, maybe developing one side projects like XCUITest for your project may give worse results than expected.

What is XCUITest?

XCUITest is a UI testing framework launched by Apple in 2015.

XCUITest is part of XCode. It is preferred by developers to get faster and more reliable results for UI tests on Xcode.

Briefly, the following reasons have affected its popularity.

  1. Reliable
  2. Quick to Develop
  3. Test Maintenance is easy

Creating an XCUITest Project

  1. The project opens with XCode.
  2. UI Testing Bundle is selected on the screen that comes with New -> File ->Target.

3. Relevant project information is entered. The target application to be written UI Test is selected. and click Finish.

Now the file where the UI Test can be written has been created. Everything up to this step is basically the same for all projects. The next part of the process is to design the test architecture and start developing the tests on a particular architecture.

What can be done with XCUITest?

With the Project navigator tab, you can see the project file structure as the main project and UI Test file as above. If Unit Test exists, there may be a file in Unit Test here.

In the Test Navigator tab, you can see all the files belonging to your test. You can run or disable these tests here.

You can get step-by-step information about the test running with jump to report. You can see that it automatically saves the screenshot of the step it failed.

You can change test settings such as parallel test, test run order, location, system language and data on the screen opened with Product -> Scheme -> Edit Scheme.

We can also create and run different different test plans.

The last feature we will talk about is the Record UI Test. Thanks to this feature, someone who has no coding knowledge can write the desired interface tests. Although it is a fast and easy-to-use feature, it is not preferred because of code complexity and irregular code output, except in certain situations.

CONCLUSION

In this article, I tried to explain how to run our tests with XCode-XCUITest and what we can do. Thank you for reading and feel free to contact me if you have any questions.

Feedback 📬

If you have patiently followed me up to this point and you think we could do it better this way, here is the reason for you to contact me! I am ready to listen to your advice, criticism and feedback that can improve me or you. Contact Us. Thanks…

--

--

Mesut Beysülen

Senior QA-Test Automation Engineer @MigrosOne, Ex @hepsiburada | Instructor on Youtube @mesutbeysulen