How to get data from excel sheet to the script? write the
script.

Answers were Sorted based on User's Feedback



How to get data from excel sheet to the script? write the script...

Answer / jyothi

Set a= Createobject("Excel.Application
Set b = a.workbooks.open"D:\Keyword\Test Data\data.xls"
Set c = b.Worksheets("sheet name")


Then retrieve the data like

set x= c.cells(1,1).value

Is This Answer Correct ?    8 Yes 2 No

How to get data from excel sheet to the script? write the script...

Answer / cheryl

datatable.import("xlsheetname.xls")

Is This Answer Correct ?    10 Yes 6 No

How to get data from excel sheet to the script? write the script...

Answer / he he eheyyy he ... baa

Excel.Workbook workBook = app.Workbooks.Open(Path, 0,
true,
5,
"",
"",
true,
Excel.XlPlatform.xlWindows,
"\t",
false,
false,
0,
true,
1,
0);

//// Get The Active Worksheet Using Sheet Name Or
Active Sheet
Excel.Worksheet workSheet =
(Excel.Worksheet)workBook.ActiveSheet;

try
{
string[] email = new string[40];
for (int i = 1; i < email.Length; i++)
{
if (i <= 40 )
{
if
(((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2
!= null)
{
rowIndex = 2 + index;
string emailid =
((Excel.Range)workSheet.Cells[rowIndex,
colIndex1]).Value2.ToString();
//string[] email = new string[9];

//string lastName =
((Excel.Range)workSheet.Cells[rowIndex,colIndex2]).Value2.ToString();
//string emailid =
((Excel.Range)workSheet.Cells[rowIndex,
colIndex3]).Value2.ToString();
Class1.SendMail(emailid);

//Response.Write(emailid);




index++;

}
}
}

}
catch (Exception ex)
{
app.Quit();
Response.Write(ex.Message);
}
}

Is This Answer Correct ?    1 Yes 1 No

How to get data from excel sheet to the script? write the script...

Answer / srinath

close the excel sheet which you want to open in QTP
first row will always be column name which will be used in
script

datatable.import("c:\path,,,\xlsheetname.xls")
a=datatable.value("jksdfj")

Is This Answer Correct ?    3 Yes 4 No

How to get data from excel sheet to the script? write the script...

Answer / rao' prasad

DataTable.Import("xlsheetname.xls")
For i=1 to DataTable.GetRowCount step 1
DataTable.SetCurrentRow(i)
........................................
.......................................
Stmts
......................................
...................................
DataTable.SetNextRow
Next

Is This Answer Correct ?    4 Yes 5 No

How to get data from excel sheet to the script? write the script...

Answer / murali k m

datatable.Importsheet "D:\Keyword\Test Data\data.xls"

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More QTP Interview Questions

Syntax for how to call one script from another? and Syntax to call one "Action" in another?

3 Answers  


Explain QTP using different development techniques ?

0 Answers  


Hi my name is mohan. I am working as a manual tester.. And now i want learn QTP.. is there any online websites to learn QTP for free if u know any plz help me out..,.or send mail to k.mohann.mohan@gmail.com

3 Answers   Wipro,


Give me exact application where we should use low level recording?

6 Answers   CTS,


what type of application we can select for automation testing and what is the entry criteria for automation

1 Answers  






hi everybody this questions is only for qtp real time users. anyone please clearly explain the approach u r following for qtp testing in ur company or qtp framework u r following in ur company pelase give me clear explanation then u did great favour to inexeprienced qtp users

0 Answers   Automobile, EDP,


What is the difference between keyword driven frameworkd and Modularisation framework?(Chandana)

5 Answers   Wipro,


Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji

0 Answers   TCS,


How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?

0 Answers  


Can you expect major bugs in Net banking Application?

1 Answers  


Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Advance

3 Answers   BirlaSoft,


How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. Whatz the difference between them? how to handle script issues?

2 Answers  


Categories