Automation on Unity Engine application - Ways to automate Unity Game Engine applications using Unity Test Runner and Autoplay,Selenium tool.

Unity 3D game engine is used to develop games and enterprise application development in multiple platform which is compatible across devices. It is an excellent cross development tool, especially used for Next-Gen technologies like augmented and virtual reality applications.

As everyone is familiar with the terms like appium, selenium for automation in mobile application, it's quite a big challenge and uncertain when it comes to automation in mobile application built in Unity engine. Here we will discuss about the solution on automating unity built application using following methods:

  1. Using Unity Test Runner - which comes with Unity application using [UnityTest] attribute
  2. Using AutoPlay, Selenium - Similar to web testing with inspector and web driver protocol support.

Method 1 : Unity Test Runner

  • The Unity Test Runner is a tool that tests your code in both Edit mode and Play mode, and also on target platforms such as Standalone, Android, or iOS.
  • The Unity Test Runner uses a Unity integration of the NUnit library, which is an open-source unit testing library for .Net languages.
  • [UnityTest Attribute] - Addition to the standard NUnit library for the Unity Test Runner.

Method 2: Using AutoPlay and Selenium

  • Inspect game scene
  • Manage game on real devices (install / uninstall, start / stop, etc)
  • Run Selenium tests (with all base selenium actions like click, getText, swipe, get elements property, etc)
  • Write test on any programming language (Java, C#, python, etc)

Looking forward to meet you all in SeleniumConf 2020


Outline/Structure of the Tutorial

  • Introduction to Unity Engine - 5 mins
  • How to automate on android application build using Unity Engine - 5 mins
  • Unity Test Runner - 15 mins
    • Play Mode Test
    • Unity and NUnit Attributes
    • Run from Command Terminal
  • Using Autoplay - 10 mins
    • Autoplay
    • Selenium
    • Serenity
  • Reporting - 10 mins

Learning Outcome

Help the participants to understand

  • Scope of automation in unity application
  • Approaches to be made to automate the Unity application

Target Audience

Test Automation Engineers of all levels

Prerequisites for Attendees

Basic Knowledge on Unity Game Engine, NUnit and Selenium

schedule Submitted 11 months ago

Public Feedback

    • Shweta Sharma

      Shweta Sharma / Nikita Jain - Accessibility testing 101

      45 Mins

      "This world is such a beautiful place to live in." If you can read the first sentence without any screen readers or assistance, you're privileged. As technologists, shouldn’t we be more empathetic towards differently-abled people and make all parts of our website accessible to them? In my humble opinion, the true power of technology can be identified when it reaches out to people of all kinds having different physical or psychological challenges. We not only legally bound to provide Accessibility but also it should be considered as our moral responsibility.

      As testers, we have a wonderful opportunity to contribute to Accessibility by ensuring that the site is accessible in many different ways. Although it is impossible to identify all the issues that exist around Accessibility in the world, we are lucky enough to still understand a majority of them. With this understanding, there have been many measures taken in order to make your site accessible. But, don’t forget - we are QA engineers. We got to ensure that the site is accessible as per the standards set by WCAG 2.0 (AA) by testing for accessibility using various tools and techniques.

    • Abhijeet Vaikar

      Abhijeet Vaikar - End-end test code as a first class citizen

      45 Mins
      Case Study

      "All tests in today's automated regression run have been marked as Untested. What happened?"

      "No notifications are being sent for test runs on the channel"

      "I pulled latest code, and the framework dependency shows compilation error"

      "What does this new method in the framework do?"

      How often do you hear such things within your team?

      As Quality champions, we need to walk the talk. When we expect our developers to write quality code, write unit tests, build features without introducing bugs, the onus lies on us (as test engineers) to do the same. With almost every test engineering team writing automated tests to check functionality of their products and services, it becomes very important to ensure that the test automation framework and the test scripts are bug-free and follow good standards of software engineering.

      It cannot be stressed enough that test automation code should be as good as production code. In order to build production-quality test automation framework and scripts, a number of steps can be taken at:

      1. Code & System Level

      2. Process & People Level

      Our test engineering team went through a transition from having random & unexpected failing test runs to having greater confidence in the quality of the tests. Learn from this case study of our journey to ensure that end-end UI automated tests are built with quality in mind. We will also see demonstration of some of the use cases.

    • Gaurav Singh

      Gaurav Singh - How to build an automation framework with Selenium : Patterns and practices

      Gaurav Singh
      Gaurav Singh
      Test automation Lead
      schedule 1 year ago
      Sold Out!
      45 Mins

      With an ever increasing no of businesses being conducted on web the testing need to write automated tests for the app's UI is something that can never be ignored. As you all know Selenium provides an API that enables us to do this quite effectively.

      However, when tasked with setting up the automation framework, there are a lot of questions that arise in the minds of aspiring test developers regardless of what level they are in their career.

      Some of such questions are:

      1. How does one actually go about the business of building a robust and effective automation framework on top of selenium?
      2. What are the elementary building blocks to include in the framework that an aspiring automation developer should know of?
      3. How should we model our tests? XUnit style vs BDD?
      4. Are there good practices, sensible design patterns and abstractions that we can follow in our code?
      5. What are some of the anti patterns/common mistakes we should avoid

      A lot of literature, documentation and blogs exists on these topics on the web already.

      However In this talk,

      I would combine this existing knowledge and my years of experience in building automation frameworks and breakdown these elements and walk you through exactly the sort of decisions/considerations and practices that you can take while starting to implement or improve the UI automation for your team.

      Hope to see you there!

    • Shi Ling Tai

      Shi Ling Tai - Start with the scariest feature - how to prioritise what to test

      Shi Ling Tai
      Shi Ling Tai
      schedule 11 months ago
      Sold Out!
      20 Mins

      It can be intimidating for inexperienced teams embarking on their test automation journey for an existing code base. There is so much to test, and so many ways to test. I often see teams stuck with debating on where to start and what tools to use and best practices:

      "We should start from unit tests"

      "No, integration tests are better!"

      "Should we use tool A or tool B?"

      I see this play out all the time, and I've been there before. And the worst that could happen is decision paralysis and inaction.

      The bigger question really is "What to test?".

      My rule of thumb is "Start with the scariest code". I'll share with you my framework for evaluating the ROI of writing a test for a feature and prioritising what to test.

    • Shi Ling Tai

      Shi Ling Tai - Accessibility and Testability - two sides of the same coin

      Shi Ling Tai
      Shi Ling Tai
      schedule 11 months ago
      Sold Out!
      45 Mins

      What makes a UI testable?

      If you've ever struggled with testing icon buttons, sliders, datepickers, you know what I mean. Those things are a pain to test, and the tests you've written is probably not very maintainable either.

      Here's an argument on making UI more accessible - it's means your UI is more testable too - let me show you what I mean.