How to get data from excel sheet to the script? write the
script.
Answer Posted / 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 |
Post New Answer View All Answers
Can anyone pls tell me in realtime (descriptive programming) how will the properties of the object be given to the test team. R they given in an excel sheet and is the same sheet also given to the development team and by whom is this given? Thanks a lot.
Explain the difference between data driven testing and parameterization ?
What is the difference between qtp and selenium?
How will you declare a variable in qtp?
Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also
wht type of User defined functions or Java Releated functions do we write in VB scripting
How to write business scripts using object repository with different scenarios
What are the data types in qtp?
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
Does QTP record on Objects created on XWindows Environment?
What does it mean when a check point is in red color? What do you do?
What is the difference between keyword view and expert view?
What is text/text area checkpoint?
1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?
Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.