This project explores the possibility of automatically converting manual test cases to selenium automation.
Usage:
For executing test steps in run time -
Run the main.py file and write steps similar to this syntax -
- Open chrome browser
- Load www.xyz.com url
- Enter/Type xyz in abc field
- Click on/at (the) abc link/button
- Hit/Press xyz key
This is acheieved using NLP(Natuaral Language Processing). NLTK is the library used. The algorithm is briefly explained as follows -
First stage -
Tokenizing the sentence using default tokenizer in NLTK.
Second stage -
Tagging the tokenized words. Following custom tags are used -
- Action (A) - Action which needs to be performed i.e. click, type, hit, open, etc.
- Action Item Name (AIN) - The visible text of the web element user needs to perform action on.
- Action Item Kind (AIK) - The kind of the action item element on which the action is supposed to be performed. Ex- button, link, etc.
- Action Data (AD) - The data associated with the action. Ex - the data needed to be entered in a text field.
- IN (preposition/subordinating conjunction : same as IN tag from nltk.pos_tag()) - Words like in,at, etc.
- DT (Determiner : same as DT tag from nltk.pos_tag()) - the.
Following features are considered to train the model to tag the words -
- word itself
- previous word
- tag of previous word
- next word
Third stage -
Taking the tagged input and creating and then executing appropriate Selenium commands.
Here is a video of the project in action - https://www.youtube.com/watch?v=Da6uHIWtQyQ