Hi Priya,
There are two ways to write test scripts in QTP.
1. Record/Playback
2. Descriptive programming.
In record / Play back, you need to record the user actions and then you have to enhance the recorded script based on your specific requirements. In your case, the field should accept 3-15 alpha characters. For which you need to record the application for an invalid (let me assume error message for all the invalid cases is same) and a valid inputs and stop recording. Now your keyword view has the steps you have followed while recording. Add text check point for the error message. After adding check points, Click on the value column of the Employee name field and click on the "Configure the Value" button present in that cell. Now Value configurations options will be displayed in which select paramenter option, DataTable in the combo box, Enter a name in the Name combo box,say, "test" and Click OK. Now your data table will have a column "test" underwhich add all the possible inputs. (This is called as parameterizing the test). Now using conditional statements (if..then..else, while, etc..) you can validate the field.
For example, find the length of the input and check if the input's length is less than 3. If yes, Check whether the error message is displayed using the Text Check Point.
In Descriptive Programming, Recording will not come into picture. The whole test script will be written manually in VBScript. If you become proficient in recording and running, its easy to understand descriptive programming.
Thanks,
There are two ways to write test scripts in QTP.
1. Record/Playback
2. Descriptive programming.
In record / Play back, you need to record the user actions and then you have to enhance the recorded script based on your specific requirements. In your case, the field should accept 3-15 alpha characters. For which you need to record the application for an invalid (let me assume error message for all the invalid cases is same) and a valid inputs and stop recording. Now your keyword view has the steps you have followed while recording. Add text check point for the error message. After adding check points, Click on the value column of the Employee name field and click on the "Configure the Value" button present in that cell. Now Value configurations options will be displayed in which select paramenter option, DataTable in the combo box, Enter a name in the Name combo box,say, "test" and Click OK. Now your data table will have a column "test" underwhich add all the possible inputs. (This is called as parameterizing the test). Now using conditional statements (if..then..else, while, etc..) you can validate the field.
For example, find the length of the input and check if the input's length is less than 3. If yes, Check whether the error message is displayed using the Text Check Point.
In Descriptive Programming, Recording will not come into picture. The whole test script will be written manually in VBScript. If you become proficient in recording and running, its easy to understand descriptive programming.
Thanks,