Micro Focus QTP (UFT) Forums
Write in Excel - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Write in Excel (/Thread-Write-in-Excel)

Pages: 1 2 3 4 5


RE: Write in Excel - Anu - 08-23-2010

Hi,

i tried by removing the parathesis but now error is coming on below line:
If ((temp%10)=0) Then
Please find the screen shot.


RE: Write in Excel - venkatbatchu - 08-23-2010

Hi Anu,

Try with the below code.

Code:
temp=10
result=temp mod 10
If result=0 Then
Browser("xxxxxxxxx").Page("xxxxxxxxx").Weblink("Next").Click
End If

Please use the appropriate terminology thats suits for ur frame work
Please let me know for further clarification.


Regards,
Venkat.Batchu


RE: Write in Excel - Anu - 08-23-2010

Hi,

After doing the said modification, again error is coming on below line

Datatable.AddParameter "CustomerName",""
Please look into the code given by me having excel object and please provide a work around for this problem...........

Regards,
Anu


RE: Write in Excel - venkatbatchu - 08-23-2010

Hi,

Use the paranthesis for the below one...

Code:
Datatable.AddParameter ("CustomerName","")


Let me know for further clarification.


Regards,
Venkat.Batchu


RE: Write in Excel - Anu - 08-23-2010

Hi,

After adding the paranthesis, it is not working. This throughing he following error


RE: Write in Excel - venkatbatchu - 08-23-2010

If you are intrested to give url and then i can try to give complete code for the thing which u wnat.

Regards,
Venkat.Batchu


RE: Write in Excel - Anu - 08-23-2010

Hi,

The url is "http://bsnl.co.in/onlinedirectory.htm"
On opening the url, select Gujarati Language.

Regards,
Anu


RE: Write in Excel - venkatbatchu - 08-23-2010

Hi Anu,
Try with the below code it works fine
i have taken few assumptions.intrcount=22
Code:
intrcount=22
Datatable.GlobalSheet.AddParameter "Phoneno",""
Datatable.GlobalSheet.AddParameter "Name",""
Datatable.GlobalSheet.AddParameter "Address",""
temp1=0
For temp=2 to intrcount-1 step 1
temp1=temp1+1
Datatable.SetCurrentRow(temp1)
intphoneno=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.Value("Phoneno","Global")=intphoneno
Datatable.Value("Name","Global")=strname
Datatable.Value("Address","Global")=straddress
If (temp-1) mod 10=0 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
temp=temp-10
End If
Wait 1
Next


Please let me know for further clarification



Regards,
Venkat.Batchu....


RE: Write in Excel - Anu - 08-24-2010

Hi,

Could you please tell me where it will write the data?

Regards,
Anu


RE: Write in Excel - venkatbatchu - 08-24-2010

Hi Anu,

First it will write the data to the data table onCe all data comes to data table i.e by executing script then we can export the data at last to external source i.e excefile which will be stroed in ur disk.

Please let me know for further clarification.

Regards,
Venkat.Batchu