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
HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com
Explain how you can find length of array in qtp?
Why we load add-ins in qtp?
whare exactly we have to use functions and sub routain
How to modify object property in qtp ?
How to handle dynamic objects in quicktest professional?
How will we compare the texts in the two word files using QTP writing the script in Descriptive Programming. Thanks
what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?
What is active screen?
QTP 10.0 is not identifying web objects for IE 8.it is identifying like winObject.I installed HP patch QTPWEB_00037.Still getting issue
How do you configure QTP AND Test director?
Have you done batch testing in qtp? If yes how you are doing?
what is output value in QTP and how it can be used in automation testing
Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?
Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks