hey please tell me how to retriev data from excel sheet
which puts the login name and password in the application?
plz send me the code..please help me

Answers were Sorted based on User's Feedback



hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / siri

set ex= CreateObject("Excel.Application")
set wrkbk= ex.workbooks.open(excelbookpath)
set objDriverSheet=wrkbk.worhsheets("Sheetname")

dim lgin,pwd,row
for i=0 to 5
row=i
lgin=objDriverSheet.Cells(row,"A")
pwd=objDriverSheet.Cells(row,"B")
msgbox lgin
msgbox pwd

next

Is This Answer Correct ?    3 Yes 0 No

hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / bfakruddin

option explicit
dim xl,rc,UserID,pwd

set xl=createobject("excel.application")
xl.visible=true
xl.workbooks.open "path of your excel sheet"
xl.sheets("Sheetid").select
rc=xl.sheets("Sheetid").usedrange.rows.count
for i=0 to rc
UserID=xl.cells(i,1) 'here 1 is column no.userid contai
pwd=xl.cells(i,2) 'here 2 is column no. password contain
object.set UserID
object.set pwd
Next

Is This Answer Correct ?    1 Yes 0 No

hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / sojan davis

IF using QTP tool, you can use Import Function

Datatable.ImportSheet "C:\.\.\Data.xls","Sheet1","Global"

Is This Answer Correct ?    0 Yes 0 No

hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / manjunathareddy

Set oExcel=CreateObject("Excel.Application")
Set oBook=oExcel.Workbooks.Open(Excelpath)
Set oSheet=oBook.Worksheets(Excelsheetnumber)
oRow=oSheet.Usedrange.Rows.Count
For i=2 to oRow
Un=oSheet.Cells(i,1).Value
Pwd=oSheet.Cells(i,2).Value
Msgbox Un
Msgbox Pwd
Next

Is This Answer Correct ?    0 Yes 0 No

hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / rajani_kanth

Option explicit
Dim objExcel,objExcelSheet,row,col,i,j

Set objExcel=CreateObject("Excel.Application")
objExcel.Workbooks.Open("D:QTPdata.xlsx")
'objExcel.Application.Visible=true
Set objExcelSheet=objExcel.ActiveWorkbook.Worksheets("Sheet1")


row=objExcelSheet.UsedRange.Rows.count
col=objExcelSheet.UsedRange.Columns.count


For i= 2 to row
For j= 1 to Col
' Print objExcelSheet.cells(i,j).value

InvokeApplication"C:Program Files (x86)HPQuickTest Professionalsamplesflightappflight4a.exe"
wait 1
dialog("Login").WinEdit( "Agent Name:").Set objExcelSheet.cells(i,j).value
wait 1
J=J+1
dialog("Login").WinEdit("Password:").Set objExcelSheet.cells(i,j).value
WAIT 1

DIALOG("Login").WinButton("OK").Click
wait 1
window("Flight Reservation").Close
wait 1

Next

Next


objExcel.Workbooks.Close
objExcel.Quit
Set objExcelSheet=Nothing

Set objExcel=Nothing

Is This Answer Correct ?    0 Yes 0 No

hey please tell me how to retriev data from excel sheet which puts the login name and password in ..

Answer / chakkara

you can do like this:
1. import the data into local sheet from excel
datatable.ImportSheet "path of the excel file",1,"local
sheet name"

2. assign the values to the fields

browser("").Page(" ).WebEdit(" ).Set datatable("UserName",
dtlocalsheet)

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More VB Script Interview Questions

this q asked in applabs, q is: QTP should open google.com page and enter "qtp" in one edit(search) box and click search and should open google.com again and enter "job" in edit(search) box and click on search. I tried this but getting error "Edit(search) box matches more than one object", could anyone this question plz..

1 Answers   AppLabs,


a;;b;c;;;d in this string output is abcd will come how can we do that in vbscript in QTP testing?

2 Answers  


write a vb script to rename a folder from tree4 to tree7

3 Answers  


What is the output of a + b in vbscript if a = 5 and b = 10?

0 Answers  


Hello Friends , I am the new joinner of this website. I am working with Sapient ,Gurgoan I would like to ask few qurries regarding the QTP Tool of (Testing) Currently working on QTP Tool . I would like to no learn VB Script can u name some Books which i get in market. And a small issue in QTP I had 2 users right i have to login and send the document from this user to second user right. when i am send this doc some contendId number generates right. now i am loging into second user and i have to search for that contentId right i found it now i dont want to accept the document so i had an opption of check out ok i have to click on check out my QTP Code is like this Browser(" ").Page(" ").WebTable(" ").ChildItem (3,5,"Image",0).click Browser(" ").Page(" ").Link("ChecK Out").Click i new this code is perfectly right but when i am run the script i have to click on that particular contentId and click on check out but now the Problem is started the error is the document has been already checked out remeber every time my content id changes means it is the new contentId which is not been used atleast once Please help me out in this issue i am in big trouble

0 Answers   GCE, Sapient,






compare the string without using stringcomp function?

1 Answers   CSS Corp,


can anyone tell me the procedure of interview held in applabs

0 Answers  


how to acces the remote mechine using vb cript(QTP)

0 Answers   TCS,


What is the differene between QTP 8.2 and QTP 9.0 and QTP 9.1,Pls give me answer ASAP.

3 Answers   Accenture,


Explain different types of segment?

0 Answers  


filter the array values without using filter function?

0 Answers   CSS Corp, WQED,


give me an ex. of unoverloaded method?

2 Answers   Misys,


Categories