This repository contains code to cache a given set of instructions for performing automation tasks on Android devices. The project facilitates efficient automation testing by caching instructions and reusing them to save time and resources during repetitive tasks.
Before you begin, ensure you have met the following requirements:
- Python: Python should be installed on your machine.
- Android Studio: Android Studio must be installed on your machine for Android SDK tools.
- Device Setup: Either an Android emulator should be set up, or a real Android device should be configured with Developer Options enabled and USB Debugging turned on.
Follow these steps to set up and run the project:
-
git clone https://github.com/harshit3478/drizz_caching cd drizz_caching git checkout master
-
pip install -r requirements.txt
-
For a real device, connect your phone using a USB cable and ensure USB Debugging is enabled. If using an emulator, ensure it's running.
Create your Gemini API key. Add the API key to the config.py file in the project directory.
Go to the app you want to test or provide instructions for.
-
python app.py
The terminal will guide you through the automation process.
Do not remove the empty folder in the project directory, as it is required for caching operations.
-> For the first time, the user will provide the instructions to perform the automation task. The project will cache these instructions for future use.
-> If the user wants to perform the same task again, it will be checked if the instructions are already cached. If they are, It will further perform more checks to make sure that it is the same screen and the same element.
-> If the instructions are already cached, the project will reuse them to perform the automation task efficiently.
The project uses the following approaches to cache and reuse instructions: (both of these approaches code can be find in target_elemen_finder.py file)