i am using DDT concept in Test complete now i am able to retrieve values from excel sheet but finding difficulties in coding to call the application and adding the relevant data on the
Please do help me out in this eagerly Awaiting ur help.
ex: i have created 2 columns by name Agent name and password and i have stored 3 sets of data now i need to invoke the application and parameterize my application, please provide me relevant code for this.
thanks in advance
Here is the example how to read the values from Excel and how to put them in you application.
In Test Complete it is very easy to parameterize the things than other tools.
For example if you have 10 rows and two columns . Here you need to have two dimensional array with (10,2)size then call the excel sheet wherever you want use those values.
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Ms_Excel = Sys.GetOleObject("Excel.Application"
Ms_Excel.Visible = false;
collect_value[row,column] = VarToStr(Ms_Excel.Cells(row, column).Value);
you need to do focus (or click ) on location wherever you need to put your value. Then use the following function. It pastes the current value.
-------- all your application actions
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I presume this stuff will solve your issue.
YOu need to see from other angle of the problem if you struck with any problem.
TestComplete provides you with an extended set of properties and methods to work with standard Win32 controls (See the 'Working With Win32 Controls' help topic). For example, the Win32Edit control has the wText property which represents the text of the edit control. Thus you can use this property to set/get the text of the edit control, that is:
w.Window("Edit","",-1).wText = some_data
I also recommend you to take a look at the 'How to Write Scripts' and 'Simulating User Actions' help topics.
Will u Please provide me the code in VB Scripting
The following script reads data from the Excel document and set this data to the Edit field.
PathToFile = "c:\test.xls"
ColumnCount = 10
RowCount = 10
Set ExcelApp = Sys.OleObject("Excel.Application")
Set WBook = ExcelApp.Workbooks.Open(PathToFile)
Set Sheet = WBook.Sheets(1)
Set w1 = w.Window("WndClass","WndCaption",-1)
For row = 1 To RowCount
For columns = 1 To ColumnCount
w1.wText = w1.wText & Sheet.Cells(row, column) & " "
And also will you please tell me how to invoke an application in Test Complete.
Uou can launch an application from a TestComplete script using one of the following ways:
- Use the TestedApps.Run method (you need to add the application executable file to the list of tested applications beforehand. See the 'Tested Applications' help topic fr details);
- Use the WScript.Shell OLE object and its Run method.
Set Wsh = Sys.OleObject('WScript.Shell')