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

What is the differences between image check point and bit map check point?

0 Answers  


What is a reusable action?

0 Answers  


Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.

0 Answers   Fiserv,


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1 Answers   scintel,


what the diffference between test data and test cases what is meant by object hierarchy in qtp

4 Answers   Virtusa,


Did the scripts need lot of maintenance? If yes, why?

0 Answers  


How u call functions in QTP Function to calculate the length of characters in a wor

2 Answers  


how to know no.of mails in our g mail by using vb-script

0 Answers   HP, Thinking Hats,


unique properties of button,edit box, radio button,check box?

1 Answers   IBM,


What are the different scripting languages you could use when working with QTP ?

6 Answers  


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

0 Answers   Livetek,


What is iteration? How it is related to Test Results in QTP

3 Answers   Virinchi Technologies,


Categories