4.0 KiB
4.0 KiB
QuBeCare Login Form Troubleshooting Guide
Issue: LiveKit Agent Not Filling QuBeCare Login Form
Potential Causes and Solutions
1. Page Loading Issues
- Problem: Form elements not loaded when agent tries to fill them
- Solution:
- Ensure page is fully loaded before attempting form filling
- Add delays after navigation:
await asyncio.sleep(3)
- Check page load status with JavaScript
2. Dynamic Form Elements
- Problem: QuBeCare uses React/Vue.js with dynamically generated form elements
- Solution:
- Use enhanced form detection with JavaScript execution
- Wait for elements to appear in DOM
- Use MutationObserver to detect when forms are ready
3. Shadow DOM or iFrames
- Problem: Login form is inside shadow DOM or iframe
- Solution:
- Check for iframe elements:
document.querySelectorAll('iframe')
- Switch to iframe context before form filling
- Handle shadow DOM with special selectors
- Check for iframe elements:
4. CSRF Protection or Security Measures
- Problem: Site blocks automated form filling
- Solution:
- Simulate human-like interactions
- Add random delays between actions
- Use proper user agent and headers
5. Incorrect Selectors
- Problem: Form field selectors have changed or are non-standard
- Solution:
- Use the enhanced form detection method
- Try multiple selector strategies
- Inspect actual DOM structure
Debugging Steps
Step 1: Run the Debug Script
cd agent-livekit
python debug_form_detection.py
Step 2: Check Agent Logs
Look for these log messages:
- "Auto-detecting all input fields on current page..."
- "Enhanced detection found X elements"
- "Filling field 'selector' with value 'value'"
Step 3: Manual Testing
- Navigate to https://app.qubecare.ai/provider/login
- Use agent command:
get_form_fields
- If no fields found, try:
refresh_input_fields
- Use the new specialized command:
fill_qubecare_login email@example.com password123
Step 4: Browser Developer Tools
- Open browser dev tools (F12)
- Go to Console tab
- Run:
document.querySelectorAll('input, textarea, select')
- Check if elements are visible and accessible
Enhanced Commands Available
New QuBeCare-Specific Command
fill_qubecare_login email@example.com your_password
Enhanced Form Detection
get_form_fields # Now includes JavaScript-based detection
refresh_input_fields # Manually refresh field cache
Debug Commands
navigate_to_url https://app.qubecare.ai/provider/login
get_form_fields
fill_qubecare_login your_email@domain.com your_password
submit_form
Common Issues and Fixes
Issue: "No form fields found"
Fix:
- Wait longer for page load
- Check if page requires login or has redirects
- Verify URL is correct and accessible
Issue: "Error filling form field"
Fix:
- Check if field is visible and enabled
- Try clicking field first to focus it
- Use different selector strategy
Issue: Form fills but doesn't submit
Fix:
- Use
submit_form
command after filling - Try pressing Enter key on form
- Look for submit button and click it
Technical Implementation Details
The enhanced form detection now:
- Uses multiple detection strategies
- Executes JavaScript to find hidden/dynamic elements
- Provides detailed field information including visibility
- Identifies login-specific fields automatically
- Handles modern web application patterns
Next Steps if Issues Persist
- Check Network Connectivity: Ensure agent can reach QuBeCare servers
- Verify Credentials: Test login manually in browser
- Update Selectors: QuBeCare may have updated their form structure
- Check for Captcha: Some login forms require human verification
- Review Browser Profile: Ensure correct browser profile is being used
Contact Support
If the issue persists after trying these solutions:
- Provide debug script output
- Share agent logs
- Include browser developer tools console output
- Specify exact error messages received