Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write in Excel
#48
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Anu,


Please follow the below approach

1. File-->Settings-->Run-->Run One Iteration only
2. Copy the entire code as I mentioned below
3. Add the objects to object repository as like in the attached screen shot (Here “Phone table” object and “Next link” are in object repository)
4. Execute the script
5. Observe that it will work as expected

Code:
'intpages=Total no of pages here it is 293
Datatable.GlobalSheet.AddParameter "PhoneNo",""
Datatable.GlobalSheet.AddParameter "Name",""
Datatable.GlobalSheet.AddParameter "Address",""
For p=1 to 293 step 1
rcount=Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").WebTable("innertext:=Phone no.*").GetROProperty("rows")
For temp=2 to rcount-1 Step 1
intpno=Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").WebTable("innertext:=Phone no.*").GetcellData(temp,1)
strname=Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").WebTable("innertext:=Phone no.*").GetcellData(temp,2)
straddress=Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").WebTable("innertext:=Phone no.*").GetcellData(temp,3)
Datatable.SetCurrentRow(Datatable.GetRowCount+1)
Datatable.Value("PhoneNo","Global")=intpno
Datatable.Value("Name","Global")=strname
Datatable.Value("Address","Global")=straddress
If temp=rcount-1 Then
Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").Link("Next").Click
Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Sync
Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").Sync
Wait 3
End If
rcount=Browser("BSNL GUJARAT TELECOM CIRCLE:Ma").Page("BSNL GUJARAT TELECOM CIRCLE:Ma").WebTable("innertext:=Phone no.*").GetROProperty("rows")
Next
Next
Wait 2
Datatable.Export "C:\Output.xls"



I hope now u will get some idea.


Regards,
Venkat.Batchu


Attached Files Image(s)
   
Reply


Messages In This Thread
Write in Excel - by Anu - 05-24-2010, 09:45 AM
RE: Write in Excel - by Saket - 05-24-2010, 11:12 AM
RE: Write in Excel - by Anu - 05-25-2010, 09:43 AM
RE: Write in Excel - by basanth27 - 05-24-2010, 02:31 PM
RE: Write in Excel - by Saket - 05-25-2010, 11:08 AM
RE: Write in Excel - by Anu - 05-25-2010, 11:26 AM
RE: Write in Excel - by Saket - 05-25-2010, 12:43 PM
RE: Write in Excel - by Anu - 05-25-2010, 12:54 PM
RE: Write in Excel - by Anu - 05-25-2010, 03:19 PM
RE: Write in Excel - by Saket - 05-25-2010, 03:21 PM
RE: Write in Excel - by Anu - 05-26-2010, 10:20 AM
RE: Write in Excel - by Saket - 05-26-2010, 12:56 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:21 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:22 PM
RE: Write in Excel - by Anu - 05-26-2010, 03:49 PM
RE: Write in Excel - by Saket - 05-26-2010, 03:53 PM
RE: Write in Excel - by Anu - 05-26-2010, 04:54 PM
RE: Write in Excel - by Saket - 05-26-2010, 06:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 10:38 AM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 11:21 AM
RE: Write in Excel - by Anu - 08-23-2010, 12:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:25 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:42 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 12:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 12:58 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 01:48 PM
RE: Write in Excel - by Anu - 08-23-2010, 02:17 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 02:51 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:03 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:07 PM
RE: Write in Excel - by Anu - 08-23-2010, 03:29 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 03:54 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:00 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:26 PM
RE: Write in Excel - by Anu - 08-23-2010, 04:47 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 04:59 PM
RE: Write in Excel - by Anu - 08-23-2010, 05:05 PM
RE: Write in Excel - by venkatbatchu - 08-23-2010, 06:57 PM
RE: Write in Excel - by Anu - 08-24-2010, 09:42 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 09:53 AM
RE: Write in Excel - by Anu - 08-24-2010, 11:45 AM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 12:15 PM
RE: Write in Excel - by Anu - 08-24-2010, 01:00 PM
RE: Write in Excel - by venkatbatchu - 08-24-2010, 01:47 PM
RE: Write in Excel - by Anu - 08-24-2010, 03:03 PM
RE: Write in Excel - by Anu - 08-25-2010, 09:18 AM
RE: Write in Excel - by venkatbatchu - 08-25-2010, 05:50 PM
RE: Write in Excel - by Anu - 08-24-2010, 10:01 AM
RE: Write in Excel - by Saket - 08-25-2010, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write in Excel Continued Anu 3 3,315 08-27-2010, 08:53 AM
Last Post: basanth27
  Write Heading in excel Anu 27 19,897 08-05-2010, 03:02 PM
Last Post: Anu

Forum Jump:


Users browsing this thread: 6 Guest(s)