how can I read text in browser and export the same into text
file?
Answers were Sorted based on User's Feedback
Answer / eswar
'Modified answer foe above Script
systemutil.Run "Iexplore","www.google.com","open"
wait 5
Set desc=description.Create()
desc("micclass").value="WebElement"
desc("html tag").value="P"
Dim Fso,file_loc,Fc,Forreading,d
Set Fso=createobject("scripting.FileSystemObject")
Set Fc=Fso.CreateTextFile("D:\akh.txt",8)
Set a=browser("title:=.*").page("title:=.*").ChildObjects(desc)
b=a.count
msgbox b
For i=0 to b-1
d=a(i).getroproperty("outertext")
a(i).highlight
' print "Text -->" & d
MsgBox d
Fc.writeline"The text is : "&d
Next
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / akhaleshyadav1985
systemutil.Run "Iexplore","www.gmail.com","open"
wait 10
Set desc=description.Create()
desc("micclass").value="WebElement"
desc("html tag").value="P"
Set a=browser("title:=.*").page("title:=.*").ChildObjects(desc)
b=a.count
msgbox b
For i=0 to b-1
d=a(i).getroproperty("outertext")
a(i).highlight
print "Text -->" & d
Next
Dim Fso,file_loc,Fc,Forreading,d
Set Fso=createobject("scripting.FileSystemObject")
Set Fc=Fso.OpenTextFile("C:\aa\akh.txt",Forwriting,true)
Fc.Writeline(d)
Akhalesh Yadav
9555717928
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / uday
If u r looking the source code of a browser:
http://hpsqtp.blogspot.in/2012/03/how-to-get-source-code-of-webpage-using.html
Is This Answer Correct ? | 1 Yes | 1 No |
''Take a value from application and copy it into the text
and excel file.
a=
Browser("CreationTime:=1").Page("Micclass:=page").webButton("html
id:=ctl00_contplhDynamic_imgSignIn").GetROProperty("name")
Set fo=CreateObject("scripting.FilesystemObject")
Set otext=fo.CreateTextFile ("c:\Text11.txt")
''otext.Write a
Set oExcel=CreateObject("Excel.Application")
oExcel.Visible=True
Set oWorkBook=oExcel.Workbooks.Open("c:\Test11.xls")
Set oWorkSheet=oWorkBook.Worksheets("Sheet1").cells(1,1)
oWorkSheet.value=a
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rohit pathak
file name.Export("C:\Results\file name.xls")
First you have to tell which file you want to export and
then where you want too export that file.
Is This Answer Correct ? | 0 Yes | 2 No |
What is the differences between image check point and bit map check point?
What is a reusable action?
Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.
Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.
what the diffference between test data and test cases what is meant by object hierarchy in qtp
Did the scripts need lot of maintenance? If yes, why?
How u call functions in QTP Function to calculate the length of characters in a wor
how to know no.of mails in our g mail by using vb-script
unique properties of button,edit box, radio button,check box?
What are the different scripting languages you could use when working with QTP ?
How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one
What is iteration? How it is related to Test Results in QTP
3 Answers Virinchi Technologies,