11-18-2011, 08:40 PM
Hi Subha,
Good Morning!
Below are the steps that you have to perform inorder to achieve your goa.
Please let me know if you need any further info.
@Ankesh : The only thing that I want to bring to your notice is as we are closing the error message window, I don't understand how the Do loop will works here and more over we have to loop till we are able to enter the info successfully with the number of rows available.
Good Morning!
Below are the steps that you have to perform inorder to achieve your goa.
Code:
'Get the number of active rows from QTP Global sheet
Dim intRowCount : intRowCount = DataTable.GetRowCount
'Now you have to loop through all the rows in the Global Sheet
Dim intRowNum,strCustomerName
For intRowNum = 1 to intRowCount
'Set the current row in the global sheet
DataTable.SetCurrentRow intRowNum
'get the current row value
strCustomerName = DataTable("CustomerName",dtGlobalSheet)
'Now set the customer name
Browser("BR").Page("PG").WebEdit("CustomerName").Set strCustomerName
'Click on Add Customer Button
Browser("BR").Page("PG").WebButton("AddCustomer").Click
'Check for the error message
If Window("ErrMsgBox").Exist Then
'Close the Error message box.
Window("ErrMsgBox").WinButton("OK").Click
'write the infomation that the customer already exist.
Else
'write the infomation that the customer added successfully.
Exit For
End If
Next
@Ankesh : The only thing that I want to bring to your notice is as we are closing the error message window, I don't understand how the Do loop will works here and more over we have to loop till we are able to enter the info successfully with the number of rows available.
Thanks,
SUpputuri
SUpputuri