Appium Inspector Tutorial – Inspect Elements & XPath (Part 6)
By Bhau Automation • Mobile Automation with Appium
🎯 What You Will Learn
- What is Appium Inspector?
- How to inspect mobile app elements
- How to generate XPath
- Testing XPath inside Appium Inspector
- Writing Appium automation scripts
- Preparing for Swag Labs automation
📌 What is Appium Inspector?
Appium Inspector is a powerful tool used to inspect mobile application UI elements and generate XPath for automation testing.
⚙️ Setup Appium Inspector
- Install Appium Server
- Launch Appium Inspector
- Enter Desired Capabilities
- Start Session
🧩 XPath Examples
//android.widget.EditText[@content-desc='test-Username'] //android.widget.TextView[@text='LOGIN'] //*[@resource-id='com.saucelabs.mydemoapp:id/loginBtn']
💻 Sample Appium Code
driver.findElement(By.xpath("//android.widget.EditText[@content-desc='test-Username']")).sendKeys("standard_user");
driver.findElement(By.xpath("//android.widget.EditText[@content-desc='test-Password']")).sendKeys("secret_sauce");
driver.findElement(By.xpath("//android.widget.TextView[@text='LOGIN']")).click();
🎯 Best Practices
- Use relative XPath
- Avoid index-based XPath
- Validate XPath in Inspector
- Prefer content-desc
🎥 Watch Video
Watch Appium Inspector Tutorial
🚀 Created with ❤️ by Bhau Automation