Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export data
#1
Not Solved
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
Reply
#2
Not Solved
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Thanks For the Reply will do that....

Shayk
Reply
#4
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Export run result viewer with CAPTURED DATA and save it in PDF,or Doc,or HTML akhandesh 0 2,953 07-16-2015, 06:03 PM
Last Post: akhandesh
  export data from one sheet to another sheet in data table raaj123 1 2,345 05-21-2013, 02:21 PM
Last Post: Shahzaad
  export function is not working diya 1 2,430 12-18-2012, 11:07 AM
Last Post: Ankesh
  Importdata and Export results shayk1985 1 2,293 12-17-2012, 12:26 PM
Last Post: udayanem
  Export verification QAVA 1 2,653 11-05-2012, 10:25 AM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 2 Guest(s)