Micro Focus QTP (UFT) Forums
Descriptive programming for Data Driven in QTP - 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: Descriptive programming for Data Driven in QTP (/Thread-Descriptive-programming-for-Data-Driven-in-QTP)



Descriptive programming for Data Driven in QTP - keerthana - 06-17-2010

HI,

I faced the below question in GenPact Interview. Please give me the descriptive programming for the scenarioe.

If two text boxes are there in a "form". ....>A table contains some records which contains usernames & password....what is the script we need to write using descriptive programming concept....in QTP(simply data driven test script of qtp)?

Thanks in advance
Keerthana


RE: Descriptive programming for Data Driven in QTP - QTPLearn - 08-06-2010

You can use VBScript to automate this scenario.
1st Approach:

Add both the text boxes as an objects in Object Repository.After that use 'Global' sheet to create a table.

Code

Code:
Browser("Mercury").Page("Mercury").WebEdit("UserName").Set("UserName",dtGlobalSheet)
Browser("Mercury").Page("Mercury").WebEdit("Password").Set("Password",dtGlobalSheet)

2nd Approach:


Use 'Description.Create' for creating the object.

Code:
Set objText= Description.Create()
objText("Class Name").value = "WebEdit"
objText("name").value = "UserName"
Browser("Mercury").Page("Mercury").WebEdit(objText).Set("UserName",dtGlobalSheet)

Hope this will help you!