This is the project for Appium, Python, and Pytest. ctreport-selenium is used for reporting. Basically, it is a hybrid framework.POM and data-driven testing have been followed.
Follow the below steps to set up the environment for this project.
-
Install the Java Development Kit (JDK)
-
Set up Java Environment Variable Path (check java version by java -version) Note: Below two path need to set in the Environment Variables JAVA_HOME: C:\Program Files\Java\jdk1.8.0_112 (You have enter your path, this is just example) PATH: your-unique-entries;%JAVA_HOME%\bin (make sure that the longish your-unique- entries does not contain any other references to another Java installation folder
-
Download and install Android SDK here
-
Setup the ANDRIOD_HOME Path in the Environment Variables i.e. C:\Users\”User Name”\AppData\Local\Android\Sdk
-
Install Node JS from here: Node JS download(check node js version by node --version)
-
Also install npm after installing Node JS (npm install -g npm) (check npm version by npm --version)
-
Now we need to install Appium for Windows. Go here and download Appium for Windows.
-
Preparing Mobile Device For Automation With Appium Connect your Mobile Testing device via USB to PC. Enable Developer Mode on Mobile Phone before automating the app. Steps to Enable Developer Mode/Options on Android Phone or Tablet:
- Open Settings, Tap on ‘About’ Option, Tap on ‘Software Information’, Tap On ‘More’.
- Tap on “Build number” 7 times to enable Developer options.
- Go back to Settings and make sure that the “Developer options” setting is there.
- Tap on Developer options and turn on the USB Debugging option from the menu on the next screen.
Download and install USB Drivers for the Mobile Testing device on PC. (If the USB drivers is not present.) In adb terminal type ‘adb devices’ Type cmd in search then type adb devices —>below details will show
List of devices attached TA93305G0L device Note: This will display the list of devices connected to the system.
-
Now Start the Appium Server
-
Add the desire capabilities.(https://appium.io/docs/en/writing-running-appium/caps/) and Start the session
-
For finding the element in Mobile: o By using Appium Inspector Session o By using UiAutomatorViewer (to open UiAutomatorViewer go to Uses/”User Name”/Appdata/Local/Andriod/Sdk/tools/bin )
-
Finding App Package and Activity: We can find the App details using the Android Debugging Bridge (ADB) interface in a Command Prompt (Windows) or Terminal (Linux/Mac). 1. Firstly, connect your Android device or emulator to the PC/Mac and open the App whose details you want to inspect. 2. Open a Command Prompt or Terminal window and use ‘adb devices ‘command to see the list of connected devices. A list of Android devices connected to the Computer is displayed along with their device IDs. 3. Finally, type the below-given command to get the information about the currently open application. For Mac/Linux: adb shell dumpsys window | grep -E 'mCurrentFocus' For Windows: adb shell dumpsys window | find "mCurrentFocus" Here, the part before the '/' character is the Package name and the part after that is the Activity name.