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
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 |
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 |
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 |
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 |
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 |
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 |
How will you convert a string to upper case string using vbscript?
How to add actions in driver script to run those actions in QTP?
What is vbscript?
Hi, I need to accept user inputs for login at runtime.I know i can use Inputbox but how to proceed further that i dont know. Thanks in advance
What is byref and byval parameters in vbscript?
My questions is while writting descriptve programming, lets take flight reservation. Line1: systemutil.Run "D:\Program Files\Mercury Interactive\QuickTestProfessional\samples\flight\app\flight4 a.exe" dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "mercury" dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury" dialog("text:=Login").WinButton("text:=OK").click window("text:=Flight Reservation").Activate window("text:=Flight Reservation").ActiveX ("acx_name:=MaskEdBox").Type "111111" window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").Select "Frankfurt" window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").Select "London" window("text:=Flight Reservation").WinButton ("text:=FLIGHT").Click window("text:=Flight Reservation").dialog("text:=Flights Table").WinList("text:=From").Select "13536 FRA 08.00AM LON 08.45AM SR $163.00" window("text:=Flight Reservation").dialog("text:=Flights Table").WinButton("text:=OK").Click window("text:=Flight Reservation").WinEdit("attached text:=Name:").Exist window("text:=Flight Reservation").WinEdit("attached text:=Name:").Set "sagar", Now i m getting the error in the last line. it is not accepting the WinEdit("attached text:=Name:") Please do solve this urgent...! and i want to know how to insert additional properties for an object and which properties we need to select from the object spy.
How will you get a random number between 0 and 1 in vbscript?
* ** *** Please write a code to get output like above diagram? ple explain as it how the code works?
What is the purpose of the err object in the vbscript language?
who you define variables and functions in VB?
What are the data types supported by vbscript?
There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?