Write code to create test scripts from test cases automatically.
- you will write a test case, Code should read that test case and create a test script by calling corresponding methods.
- there will be rules to writing the test cases.
test case -> Sample
- open facebook url -> 1. Open facebook url "www.facebook.com"
- enter username in text filed -> 2. Enter username "test@test.com" in "username_webelement"
- enter password -> 3. Enter username "password" in "pass_webelement"
- click on login button -> 4. Click on "login" button
- validate home page title. -> 5. Validate the home page with text "welcome to facebook" in "val_homepage_webelement"
It should create a test script.
purposed Solution :-
- Create a utlity class with proper mrthod names. In the methods pass the action, webelement, text, flag
- Now Write Test case in a format. ( it should contain few specific keywords, test data and webelements.
- Write code to convert test case in to test script. -> in to a separate file. --> This will be the main code.
Advantage over BDD -> BDD has similar functionality but we will have advantage
- It will write test scripts by seeing test cases.
- We dont have to write code everytime for the each test step.
- It will call automatically.