This project is used to automation test using Appium with Robot Framework.
- Visual Code + extension - Robot Framework Language Server
- Java Development Kit 8 or 11
- Python 3 or superior
- Android Studio
- Appium Desktop 1.20.0
- Node.js
- Appium Doctor
Obs:
- Configure the environments variable JAVA_HOME, ANDROID_HOME and PATH
- Create Android and iOS simulators or devices
- Open Android Studio.
- Click in 'Configure -> SDK Manager'.
- On tab 'SDK Platforms' choose the "OS Android" and click in "Apply".
- On tab 'SDK Tools' choose the "Android SDK Build-Tools", "Android Emulator", "Android SDK Platform-Tools","Android SDK Tools", "Intel x86 Emulator Accelerator (HAXM installer)" and click in "Apply".
- JAVA HOME
- Configure the environments variables (Open .bash_profile)
- Add or Edit
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
- Add or Edit
- Configure the environments variables (Open .bash_profile)
- ANDROID HOME
- Configure the environments variables (Open .bash_profile)
- Add or Edit
- export ANDROID_HOME=/Users/YOUR_USER/Library/Android/sdk
- export PATH=$PATH:$ANDROID_HOME/tools
- export PATH=$PATH:$ANDROID_HOME/tools/bin
- export PATH=$PATH/:$ANDROID_HOME/platform-tools
- Add or Edit
- Configure the environments variables (Open .bash_profile)
-
JAVA HOME
- Configure the environments variables (Control panel -> System -> Advanced configuration> Environment variables -> SYSTEM VARIABLES)
- New
- JAVA_HOME
- C:\Program Files\Java\jdk1.8.0_281
- Edit "PATH" adding:
- %JAVA_HOME%\bin;
- Execute command "java -version" no CMD
-
ANDROID HOME
- Configure the environments variables (Control panel -> System -> Advanced configuration> Environment variables -> SYSTEM VARIABLES)
- New
- ANDROID_HOME
- C:\Ferramentas
- ANDROID_HOME
- Edit "PATH" adding:
- %ANDROID_HOME%\tools;
- %ANDROID_HOME%\tools\bin;
- %ANDROID_HOME%\platform-tools;
- Verify the environments variables:
- Open 'CMD' and execute the commands:
- adb
- emulator
- uiautomatorviewer
- cd %ANDROID_HOME%
- emulator -list-avds
- Open 'CMD' and execute the commands:
- Open Android Studio.
- Click in 'Configure -> AVD Manager'.
- Click in 'Create Virtual Device'.
- Choose the "Phone" and click in "Next".
- Choose the "AVD Name" and click in "Finish".
- Open terminal.
- Execute command.
- The device name is returned (example: Nexus_5X_API_27).
emulator -list-avds
- Open terminal.
- Execute command
cd $ANDROID_HOME/tools
emulator @Nexus_5X_API_27
- Open terminal.
- Execute command
cd $ANDROID_HOME/tools
uiautomatorviewer
- Open XCode.
- Click in 'Simulator'.
- Choose the "Phone" and click in "Next".
- Open Appium.
- Click in 'Start Server'.
- Click in Search.
- Click in tab 'Automatic Server'.
- Click in tab 'Desired Capabilities'.
- Add the variables.
- Click in 'Start Server'.
{
"automationName": "uiautomator2",
"platformName": "Android",
"deviceName": "android-device-test",
"app": "/Users/YOUR_USER/app/twp.apk",
"udid": "emulator-5554"
}
{
"app": "/Users/YOUR_USER/app/twp.app",
"platformName": "iOS",
"platformVersion": "14.4",
"deviceName": "iPhone 11"
}
- Open project with Visual Code.
- Run test with compiler or execute commands on Visual Code terminal.
robot -d ./logs app/tests/introTest.robot
robot -d ./logs app/tests/homeTest.robot
robot -d ./logs app/tests/loginTest.robot
robot -d ./logs app/tests/radioTest.robot
robot -d ./logs app/tests/checkboxTest.robot
robot -d ./logs -i long app/tests/buttonTest.robot
robot -d ./logs -i long app/tests/spinnerTest.robot
robot -d ./logs -i long app/tests/swiperTest.robot
robot -d ./logs -i long app/tests/drag-and-dropTest.robot
- Run test with tags ("i" to include and "e" to exclude)
robot -d ./logs -i long app/tests/buttonTest.robot
robot -d ./logs -e long app/tests/buttonTest.robot
- Access on project '.logs/report.html' and open Chrome browser to see results.
- Before run the tests you need to start devices android/iOS and start appium server.