how can I read text in browser and export the same into text
file?

Answers were Sorted based on User's Feedback



how can I read text in browser and export the same into text file?..

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

how can I read text in browser and export the same into text file?..

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

how can I read text in browser and export the same into text file?..

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

how can I read text in browser and export the same into text file?..

Answer / shekhar

''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

how can I read text in browser and export the same into text file?..

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

Post New Answer

More QTP Interview Questions

in process of project exaplnation the defects are says frequently r not?

1 Answers  


How to Analyze the Checpoint results by Checking Bitmaps?

1 Answers  


What is QTP Frame Work ,and i want it in detail

2 Answers   Value Labs,


Explain how to use QTP to check broken links on a page?

0 Answers  


What is the file extension of the code file in qtp?

0 Answers  


requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how

0 Answers   FIS,


Hi What are re-usable actions in QTP? -Thank You

5 Answers   Siemens,


how many wayes we do the parameterization?

1 Answers  


how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

0 Answers  


How do you data drive an external spreadsheet?

1 Answers  


What exactly is the difference among all the three recording modes.

2 Answers   TCS,


4. what is the use of Text output value in Qtp?

1 Answers   Wipro,


Categories