Skip to main content

Universal AI-Powered Selector Generator for Web & Mobile

Generate professional-grade selectors for Web and Mobile (iOS & Android) with intelligent toggle mode and AI optimization. Navigate freely, login, browse multiple pages, then capture selectors with 95% confidence.

🌐 Web
📱 Mobile
Red: Navigate freely
Green: Capture mode

Revolutionary Features

Traditional selector generators are broken. Best Locator changes everything with AI-powered intelligence for Web and Mobile.

Organic Navigation

Navigate like a real user - browse websites, login, complete authentication flows. For mobile: interact with your app naturally while the inspector updates in real-time.

Cross-Platform Mobile Support

Inspect native apps on iOS and Android with a unified visual inspector. Supports both physical devices and emulators with real-time screen updates.

Intelligent Toggle Mode

CTRL+S to turn ON selector mode, CTRL+D to turn OFF for web. Mobile inspector provides click-to-capture with visual feedback.

Professional Selectors

Web: Prioritizes data-test, data-testid, aria-label. Mobile: Uses resource-id, accessibility-id, and content-desc for maximum stability.

Multi-page Capture

Collect selectors from different pages/screens in a single session. Perfect for onboarding flows, e-commerce checkouts, and multi-step processes across platforms.

Universal Framework Support

Generate code for Playwright, Selenium, Cypress (web) and Appium (mobile) in JavaScript, TypeScript, Python, Java, and C#.

AI-Powered Enhancement

Integrates with OpenAI and Ollama to provide intelligent selector suggestions and optimizations for both web and mobile elements.

95% Confidence Rating

Advanced validation and scoring system ensures selectors are unique, stable, and maintainable across web and mobile platforms. Industry-leading reliability.

How It Works: Web & Mobile

The breakthrough features that make Best Locator unique across platforms

1

🌐 Web: Toggle Mode

Navigate freely → Press CTRL+S to start capture → Click elements → Press CTRL+D to navigate again → Press ESC to finish.

2

📱 Mobile: Visual Inspector

Start Appium server → Run mobile-inspector → Navigate your app → Click Refresh in web inspector → Select elements to generate selectors.

3

🤖 AI Enhancement

Add --ai flag for intelligent analysis. Best Locator analyzes page/screen structure to recommend the most robust selectors for your platform.

4

📋 Framework Output

Get professional code for your testing framework: Playwright, Selenium, Cypress (web) or Appium (mobile) in your preferred programming language.

Live Demo

🌐 Web Testing
📱 Mobile Testing
🌐

Universal Framework & Language Support

One tool, multiple platforms and frameworks. Generate code for your entire tech stack.

🌐 Web Testing Frameworks

Playwright Selenium Cypress

📱 Mobile Testing Frameworks

Appium iOS (XCUITest) Android (UIAutomator2)

💻 Programming Languages

JavaScript TypeScript Python Java C#

🤖 AI Providers

OpenAI Ollama

Web Framework Support Matrix

Framework JavaScript TypeScript Python Java C#
Playwright
Selenium
Cypress

Mobile Framework Support Matrix (Appium)

Platform JavaScript TypeScript Python Java C#
Android
iOS

Generate Code for Web & Mobile

🌐 Web - Playwright (TypeScript)

# Generate TypeScript code for Playwright bestlocator pick-toggle https://app.com --ai # Output: await page.locator('[data-test="username"]') await page.locator('[data-testid="submit-btn"]')

📱 Mobile - Appium (Python)

# Generate Python code for Appium bestlocator mobile-inspector app.apk android --ai # Output: driver.find_element(AppiumBy.ID, "com.app:id/username") driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Submit")

Professional Selector Priority

Best Locator follows industry best practices for selector generation across platforms

🌐 Web Selector Priority

Priority Selector Type Confidence Example
1st data-test 95% [data-test="username"]
1st data-testid 95% [data-testid="submit-btn"]
2nd data-cy 90% [data-cy="login-form"]
3rd aria-label 85% [aria-label="Close dialog"]
4th role 80% [role="button"]
5th name 75% [name="email"]
6th id 70% #username
7th text 60% text="Sign In"

📱 Mobile Selector Priority

Priority Selector Type Confidence Example
1st resource-id 95% com.app:id/username
1st accessibility-id 95% Submit Button
2nd content-desc 90% Login Form
3rd name 85% Email Field
4th class 75% android.widget.Button
5th xpath 60% //android.widget.Button[@text="Submit"]

Traditional Approach vs. Best Locator

See why traditional selector generators fail and how Best Locator solves it for both web and mobile

Traditional Generators

The broken approach: Immediate capture on static pages with unreliable selectors

# Typical output from traditional tools # Web: await page.locator('#user-name-input-field-123') await page.locator('.MuiButton-containedPrimary-456') await page.locator('div:nth-child(3) > input:nth-child(2)') # Mobile: driver.find_element(By.XPATH, "//android.widget.Button[1]") driver.find_element(By.CLASS_NAME, "android.widget.EditText")

Forced immediate capture - No time to navigate or authenticate
Static snapshots - Can't handle login flows or dynamic content
CSS-dependent selectors - Break when styling changes
Generated IDs - Change with every deployment
Brittle XPath - Fragile to DOM/view hierarchy changes
No cross-platform support - Separate tools for web and mobile
No context awareness - Elements captured without proper state

Best Locator

The professional approach: Organic navigation with testing-specific attributes

# Professional output from Best Locator # Web: await page.locator('[data-test="username"]') await page.locator('[data-testid="login-button"]') await page.locator('[aria-label="Submit form"]') # Mobile: driver.find_element(AppiumBy.ID, "com.app:id/username") driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Submit")

Organic navigation - Browse naturally, login, navigate multiple pages/screens
Cross-platform support - Web (toggle mode) and Mobile (visual inspector)
AI-powered optimization - OpenAI & Ollama integration for intelligent suggestions
Testing-first selectors - Platform-specific stable attributes
95% confidence rating - Industry-leading reliability
Multi-page/screen sessions - Capture from different views in one session
Context-aware capture - Elements captured in their proper state
Universal framework support - Web + Mobile with all major languages

Start Generating Professional Selectors for Web & Mobile

Join developers and QA engineers who have revolutionized their testing workflow across platforms

npm install -g bestlocator