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 |
how to tell about testing a website in interview using qtp?? what r the points to be covered mainly?
How can i check items sorted or not in a weblist ? Give me the script for this...
What is the difference between QTP 8.2 and QTP 9.2
How to Run a Test using QTP?
What is diffrence between Global variables and Environment variables...Anybody can give me answer..Thanks in advance..
How can we retrieve the links from a web page where links are dynamically changing(for eg take a online shopping website) and then we have to click on all the links present in the webpage and go to the repective pages and again come back to the first page..
In Test Director , You can store Test cases or vb Script . Why we need VSS?
How many types of status are there?
types of output value in details.
What is test object model in quicktest professional?
is it possible to check the text displayed in the tool tip using QTP? if so, how?
How many types of recording modes in qtp? Describe each type with an example where we use them?