Export data - shayk1985 - 05-17-2013
Hi All,
I want to export data into different excel rows. Here is my script. I want the TimetakenB2 in second row but it is always override the first row. please suggest.
Code: 'Importing Data file
Datatable.Import "C:\Users\Desktop\Page_Load_Time.xls"
Datatable.GetSheet (1)
'Login Process
StarttimeA1= Timer
Browser("Browser").Page("Page").WebEdit("Account_Name").Set xyz
Browser("Browser").Page("Page").WebEdit("User_Name").Set abc
Browser("Browser").Page("Page").WebEdit("Password").SetSecure 1234
StarttimeA2 = Timer
Browser("Browser").Page("Page").WebButton("Login").Click
If Browser("Browser").Page("Page").WebElement("Store 0133 Deer Valley").Exist Then
Print "Login Process Complete"
End If
EndtimeA2 = Timer
EndtimeA1 = Timer
Calender_Page = Browser("Browser").Page("Page").GetROProperty("URL")
TimeTakenA1 = EndtimeA1 - StarttimeA1
TimeTakenA2 = EndtimeA2 - StarttimeA2
Datatable.Value (1,1) = "Login"
Datatable.Value (2,1) = "Login Page - Calender View Page"
Datatable.Value (3,1) = TimeTakenA2
Datatable.Value (4,1) = TimeTakenA1
Datatable.Value (5,1) = Calender_Page
Datatable.Export "C:\Users\Desktop\Page_Load_Time.xls"
'Navigating to Customer Tab
StarttimeB1 =Timer
Browser("Browser").Page("Page").Link("Customers").Click
If Browser("Browser").Page("Page").WebElement("Find a Customer").Exist Then
Print "Customer Tab Clicked"
End If
EndtimeB1 = Timer
TimeTakenB1 = StarttimeB1 - EndtimeB1
Customer_Page = Browser("Browser").Page("Page").GetROProperty("URL")
Datatable.Value (1,1) = "Click Customer Tab"
Datatable.Value (2,1) = "Calender View Page - Search Customer"
Datatable.Value (3,1) = TimeTakenA2
Datatable.Value (4,1) = TimeTakenA1
Datatable.Value (5,1) = Customer_Page
Datatable.SetNextRow
Datatable.Export "C:\Users\Desktop\Page_Load_Time.xls"
Thanks
Shayk
RE: Export data - basanth27 - 05-17-2013
Where is your TimetakenB2? I couldnt find it. BTW, a quick suggestion is, you have hardcoded the same cell values and hence the first one will always be updated with the second set. You may want to iterate using a forloop and then set the value based on the iteration.
RE: Export data - shayk1985 - 05-17-2013
Thanks For the Reply will do that....
Shayk
RE: Export data - venugqtp - 05-18-2013
Try Below, In your code you are trying to export xls in 2 instance with same name so it over writes the 1st instance
Code: Datatable.Value (1,1) = "Login"
Datatable.Value (2,1) = "Login Page - Calender View Page"
Datatable.Value (3,1) = TimeTakenA2
Datatable.Value (4,1) = TimeTakenA1
Datatable.Value (5,1) = Calender_Page
'Navigating to Customer Tab
StarttimeB1 =Timer
Browser("Browser").Page("Page").Link("Customers").Click
If Browser("Browser").Page("Page").WebElement("Find a Customer").Exist Then
Print "Customer Tab Clicked"
End If
EndtimeB1 = Timer
TimeTakenB1 = StarttimeB1 - EndtimeB1
Customer_Page = Browser("Browser").Page("Page").GetROProperty("URL")
Datatable.Value (1,2) = "Click Customer Tab"
Datatable.Value (2,2) = "Calender View Page - Search Customer"
Datatable.Value (3,2) = TimeTakenA2
Datatable.Value (4,2) = TimeTakenA1
Datatable.Value (5,2) = Customer_Page
|