Unity/libgdx Application Automation with Appium and Poco-Airtest

This work is dedicated to resolving integrating functional testing to automation in Unity games. Functional testing is typically performed manually by QA testers, but many cases could be achieved with the right tools for non-standard GUI’s like Unity game applications. While we can use image recognition, it is not a practical solution, considering the memory it would consume. We have created a solution where we could use Poco as the tools to get the UI element control search of the GUI and use Appium’s touch capabilities to perform actions on the application and designed our Pocodriver, which integrates poco and appium, which helps us write the functional test cases efficiently. 

 
 

Outline/Structure of the Talk

Unity Application GUI Testing using Appium and Poco

While Appium can identify the UI elements of the native applications, verifying a Game platforms’ GUI is still not implemented. This is where Poco is useful. By integrating Poco-SDK into a game application, the Poco-SDK can retrieve its GUI page source, which can be received through a TCP socket connection. 

Creating PocoDriver, PocoElement and using them for appium communication.

Now that we have received the Page source, which would contain the Page Elements in JSON format, we have added two classes PocoDriver ---- a class that would help us find the desired PocoElement, and PocoElemet ---- a class that would help find and initialize an element. 

We have the following methods in PocoElement, which would help us interact with a particular element in the GUI of the Unity application page.

  1. Click ---- clicks on the element (uses appium touch action to click on the element)
  2. getText ------ gets the text of the element
  3. isDisplayed ---- verify if the element is displayed
  4. waitForElementToAppear---- wait until element appears

These methods are very much similar to the appium techniques used for the native elements. PocoElements can now act identical to the Elements in Native appium.

Similar to AppiumDriver, we have defined PocoDriver class, which can help in communicating with the Application. We have defined the following classes in the PocoDriver class.

  1. findElementByID ------ This function would help us go through the JSON page source received from airtest and poco recursively to find the given element and create a PocoElement from the attributes of the given class.
  2. findElementsById ----- Searches for multiple elements in the same JSON page and returns a list of PocoElements with the same id.
  3. waitForPocoElementToBePresent ---- wait for a particular time till a PocoElement appears.

 

Using PocoElement and PocoDriver classes, we can now use the same framework for writing Native test cases to write test cases for Game applications. We have used this method for the Unity Games on android, iOS, and web Unity applications.

 

Learning Outcome

You will get an ideal how to automate games which are build with Unity and libgdx.

Target Audience

Game Testers

Prerequisites for Attendees

Basic knowledge on GUI testing, game engines, automation, poco, Unity, Appium and libgdx.

schedule Submitted 1 week ago

  • Anil Patidar
    keyboard_arrow_down

    Anil Patidar / Jitu Patel - Unleashing the Power of mitmproxy for Mobile App Performance Optimization through Network Traffic Profiling

    20 Mins
    Experience Report
    Beginner

    Mobile app performance is a critical factor in ensuring user satisfaction, retention, and ultimately business success. Network traffic is one of the primary contributors to mobile app performance, and understanding its characteristics can lead to better insights and optimization opportunities. Mitmproxy is a powerful open-source tool that allows for the interception and analysis of HTTP traffic, making it an ideal candidate for mobile app performance analysis.

    In this conference, we will explore how mitmproxy can be used to intercept all network HTTP requests and responses of a mobile app to gain valuable insights into its performance. We will discuss how to set up mitmproxy to capture network traffic on a mobile device and use its filtering and analysis capabilities to identify performance bottlenecks. Furthermore, we will explore how to use mitmproxy to profile network requests and responses, analyze latency and throughput, and identify optimization opportunities.

    By attending this conference, you will learn how to leverage mitmproxy to gain a comprehensive understanding of mobile app performance and how to optimize it through network traffic interception and analysis. You will leave with practical knowledge and advanced techniques for using mitmproxy to achieve optimal mobile app performance.

  • Saorabh Singh
    keyboard_arrow_down

    Saorabh Singh / Jitu Kumar Patel - Unity/libgdx Application Testing Automation with Appium and Poco-Airtest

    20 Mins
    Talk
    Intermediate

    This work is dedicated to resolving integrating functional testing to automation in Unity games. Functional testing is typically performed manually by QA testers, but many cases could be achieved with the right tools for non-standard GUI’s like Unity game applications. While we can use image recognition, it is not a practical solution, considering the memory it would consume. We have created a solution where we could use Poco as the tools to get the UI element control search of the GUI and use Appium’s touch capabilities to perform actions on the application and designed our Pocodriver, which integrates poco and appium, which helps us write the functional test cases efficiently. 

help