Page Validation for Web Application - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Page Validation for Web Application (/Thread-Page-Validation-for-Web-Application) |
Page Validation for Web Application - learnqtsw - 10-08-2010 Hi All, Please show sample scripts for validating mandatory fields of a web page. I want to check if user tries to save form data without entering data for mandatory field, if the developers has called the required function or not. Thanks Swati RE: Page Validation for Web Application - KavitaPriyaCR - 10-08-2010 I am assuming the scenario as: There is a webpage with fields User Name, Place and DOB. User Name is required field and other 2 are optional. Here when user selects Save button without entering data for Usert ID, system should display error as "Please enter User Name" (Developer calls error function/script at this point). 1. Check the data in that field is empty Code: Data1=Browser("").Page("").WEbEdit("name:=Usert ID").GetROProperty("value") By using 1 and 2 we can validate the scenario. RE: Page Validation for Web Application - A.Saini - 10-08-2010 Hi, You may take the basic idea from the below code. The logic is simple submit the form with blank mandatory field & validate the text of popup message. Code: '/ * used of child object to to find out simlar objects(includes mandatory object too) I hope this will help you.... |