pls tell me how will you write the vb script in QTP for
DataDriven test from Excel sheet for multiple userid and
password explain with example

Answers were Sorted based on User's Feedback



pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / raymond brown

OK so I was thinking I would just record the login part
(username and password) and then log off, but how do I make
this a reuseable action for all the other scripts that were
already created? I want all the other scripts that use this
same userid and password to call this action so how do I do
that?

Is This Answer Correct ?    3 Yes 0 No

pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / srikanth

Create different userids and passwords in Datatable.
then..
Dialog("Login").Winedit("Userid:").set Datatable
("columnname",dtGlobalSheet)
Dialog("Login").Winedit("Password:").set Datatable
("columnname",dtGlobalSheet)
Dialog("Login").WinButton("OK").Click

Is This Answer Correct ?    2 Yes 1 No

pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / ravindra

We write different userids and passwords in Datatable.
then..
Dialog("Login").Winedit("Userid:").set Datatable.value
("userid",dtGlobalSheet)
Dialog("Login").Winedit("Password:").set Datatable.value
("password",dtGlobalSheet)
Dialog("Login").WinButton("OK").Click

Here "Userid" and "Password" are the Column names of the
datatable

Is This Answer Correct ?    1 Yes 1 No

pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / waqar ahmad

Set mySheet=myFile.Worksheets("Sheet1")
Rows_Count=mySheet.usedrange.rows.count


For i= 2 to Rows_Count step 1
SystemUtil.Run "http://qa.ktango.com"
'Browser("Knowledge Tango Login").Page("Knowledge Tango Login").("text:=Login").Activate
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set mySheet.Cells(a,"A")
Dialog("text:=Login").WinEdit("attached text:=Password:").Set mySheet.Cells(i,"B")
Wait (2)
Dialog("text:=Login").WinButton("text:=OK").Click
Window("text:=Flight Reservation").Close
Next

Is This Answer Correct ?    0 Yes 0 No

pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / deven

'Data driven Frame work script
Option Explicit
'define constants for web URL and browser name
executefile "C:\TestAutomation\openTAPS\Lib\Constants.vbs"
executefile "C:\TestAutomation\Common\Lib\UtilityFunctions.v
bs"
executefile "C:\TestAutomation\Common\Lib\SendingEmail.vbs"
executefile "C:\TestAutomation\openTAPS\Classes\Functions.vb
s"
'declare variables
Dim iRowcount, i, Username, Password
'
datatable.AddSheet("dtInvalidLogin")
'ValidLogin is the sheet name
datatable.ImportSheet "C:\TestAutomation\openTAPS\Data\TestD
ata.xls", "InValidLogin", "dtInvalidLogin"

'Get row count from datatable
iRowcount = datatable.GetSheet("dtInvalidLogin").GetRowCount

For i = 1 to iRowcount

'functions
OpenApp()

'set username and password
Username = trim(datatable.Value
("Username", "dtInvalidLogin"))
Password = trim(datatable.Value
("Password", "dtInvalidLogin"))

Login Username, Password

'Verification: check username should display on home page
If Browser("opentaps CRM").Page("opentaps CRM").WebElement
("DemoCSR").GetROProperty("outertext")=Username Then
'object.method to report events in HP Run Results
Viewer that Login is successful or not
'EventStatus - micPass shows under Results
'StepName - ValidLogin shows under Object
'UserName Login Successful shows under Details
reporter.ReportEvent micPass, "ValidLogin",
Username& " Login not successful"
WriteToFile "C:\QTP\TestAutomation\openTAPS\Logs\Tes
tResults.txt", Username & " Login successful"
Else
reporter.ReportEvent micFail, "ValidLogin",
Username& " Login successful"
WriteToFile "C:\QTP\TestAutomation\openTAPS\Logs\Tes
tResults.txt", Username & " Login not successful"
End If

'Logout
Browser("My Home | opentaps CRM").Page("My Home | opentaps
CRM").Link("Logout").Click @@ hightlight id_;_Browser("My
Home | opentaps CRM").Page("My Home | opentaps CRM").Link
("Logout")_;_script infofile_;_ZIP::ssf1.xml_;_

'close app
CloseApp()

datatable.SetNextRow
Next
'Gmail
SendMail "21deven@gmail.com", "jinideveloper@gmail.com", "QT
PTest Results", "Please find my qtp test results"
'Outlook
'SendMail("21deven@gmail.com", "QTPTest Results", "Please
find my qtp test
results" , "C:\QTP\TestAutomation\openTAPS\Logs\TestResults.
txt")

Is This Answer Correct ?    0 Yes 0 No

pls tell me how will you write the vb script in QTP for DataDriven test from Excel sheet for multi..

Answer / kalyan

Random Number Parameter Concept is there.

I wil give script later.

Any doubts call 9 66 66 757 66

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

explain all the check point in QTP?

1 Answers   BirlaSoft,


tell me types of environment variables? what r they? explain details? pls give anwer any one?

2 Answers   IBM,


Hi, I got error message as "object does not support this property or method: "Test.Actions" when i execute the following line of script on QTP 9.0 Dim qtApp, qtRep Set qtApp = CreateObject("QuickTest.Application") Set qtRep = qtApp.Test.Actions("Action1").ObjectRepositories Can anyone tell me where i am wrong.

0 Answers  


is there any addin for remedy user application

0 Answers  


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

0 Answers   Sapient, Satyam, TCS,






My Project is HOSPITAL CONTROL SYSTEM. In this MY testing modules are In-patient and Out-patient. plz explain those modules. i.e. How explain to Interviewer. with full details also . Waht types of bugs we can fond ? NOTE : IT is a web project plz urgent.

2 Answers  


HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?

0 Answers   Wipro,


How to identify flash application when the qtp is not identifying the flash application objects.

2 Answers  


How many type of status messages are there ..explain?

5 Answers  


I have thousands of links are there, i want check each and every funtionality of link by using descriptive programme, retrive link name from excelsheet then operate in application. Please anybody send me model script

1 Answers   Oracle,


How to analyzing test results using quicktest professional (qtp)?

0 Answers  


How can i use Ordinal identifiers and Smart identification methods suppose i want to know the index no of check box

1 Answers  


Categories