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

write script for , launching fr window,login and create 5 elements array and store 5 order numbers inthat array? and open order by using order no.s in array and find out maximum tickets booked by which order?

1 Answers   TCS,


Hi Guys, In one of my interviews, I was asked to Write a paragaraph explaining how much scripting I did in QTP? I don't know where to start and what to write. So I need your help in writing that.

1 Answers  


I Scheduled a QTP Script on remote desktop. Script is going to failure,when remote desktop connection fails.I have to open my remote desktop untile the scripts exection completes. If I disconnect my remote desktop connection, script is going to fail. Could you please any assist in this?

2 Answers  


Hi All, I am a beginner in QTP and have understood the basics of QTP by going through tutorial. I am trying to Automate a HRMIS application, What is the right approach to Automate this application. Kindly answer. Thanks in advance

1 Answers  


What is TOM in QTP?

0 Answers  






Have you used xml check point in your project? How?

0 Answers  


Hi friends I am new in Qtp. now i am Searching on Qtp give real time inter questions with answers.pls help me

1 Answers  


What do you mean by checkpoints in qtp?

0 Answers  


Hi Friendss..., can any body help me.. 1. Tell me your achievements(Technically)..? 2. Tell me your strengths(Technically) and weakness(Technical)..? 3. Why are you looking for change..?

0 Answers   Ness Technologies,


What is the use of running the scripts in Hidden-mode in UFT?

0 Answers  


what is the frame work your using in automation ?

4 Answers  


I am trying to read the rediffmail usign the below code. But facing problem, while i user to get the link of the mail, i am getting all the link of the page, While i just want to get only mail name - link (not all the link of an page) so that i able to read the mail message by clcking on them in qtp. Dim Lnk,Webcheckbox Set Lnk= Description. Create '********* To count and display the webcheckbox Lnk("micclass" ).value=" Link" set LinkName= Browser("Welcome to Rediffmail:" ).Page("Welcome to Rediffmail:" ).ChildObjects( Lnk) LinkCount=LinkName. Count msgbox LinkCount For i=1-1 to LinkCount-1 DataTable.SetCurren tRow(i) DataTable.Value( "Name",1) =LinkName( i).GetRoProperty ("name") Next Waiting for the reply Praveen Saini

1 Answers  


Categories