A Streamlit-based web application that generates robust XPath expressions for web automation using OpenAI's GPT models. This tool helps automation engineers create reliable XPaths by analyzing HTML snippets and optional contextual details.
- Generate the top 5 XPath expressions for a target element.
- Analyze HTML snippets and element descriptions.
- Customize XPath generation with dynamic attribute flags, element states, and ranking preferences.
- View results with advantages, disadvantages, and testing guidance.
- Copy generated XPaths easily for use in automation frameworks like Selenium or Cypress.
Follow these steps to set up the project locally:
- Python 3.8 or higher
- An OpenAI API key (sign up at OpenAI to get one)
- Clone the Repository
git clone https://github.com/yourusername/xpath-generator.git cd xpath-generator - Install the required dependencies
pip install -r requirements.txt
- Run the Application
streamlit run xpath_generator_agent.py