Micro Focus QTP (UFT) Forums
Copying data from HTML to Excel - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Copying data from HTML to Excel (/Thread-Copying-data-from-HTML-to-Excel)



Copying data from HTML to Excel - santhoshippili - 08-19-2011

Hi All,

I am fairly a new user of QTP.

I have to copy the data in the web page to Excel.
Please help me...!

Note: The data was not present in Web tables.


RE: Copying data from HTML to Excel - Arul - 08-20-2011

Santhosh,

We get the value using of getrowwithcelltext() function. To get the row of the text.
Please clearly explain ur Requirement.

Thanks,
Arul.D





RE: Copying data from HTML to Excel - santhoshippili - 08-20-2011

Hi Arul,

My requirement is like this.

Our App generates 3 reports HTML,Excel and PDF respectively.
I have to compare the three reports with master data.
So what i planned is keeping the excel report as it is, I will prepare one more excel sheet with a specific format which i need to test.

I have to copy the data from HTML and PDF to two excel sheet where i can compare the data using any excel macro or conditional formatting or something else,

The main challenge for me is to copy the required data from HTML or PDF into Excel where i can compare it.

Please help me in this regard.


RE: Copying data from HTML to Excel - santhoshippili - 11-03-2011

Hey Arul,

I want the entire page to be copied into Excel, and i am not sure whether everytime my page has a constant string.

Let us assume, you typed something in google search like "Arul" and all the related info will be displayed in the search page.

I have to copy the entire search page into excel with the same format.


RE: Copying data from HTML to Excel - Ankesh - 11-03-2011

try this...

Code:
strPageValues=Browser("").Page("").Object.body.innertext

see if it works.


RE: Copying data from HTML to Excel - santhoshippili - 11-03-2011

Ankesh,

Thank for the Quick reply, then will it will get the unnecessary td,tr,br's etc.
i want to paste this into Excel via Global Data sheet.

Any Clues.
My Second reply will clearly explain the functionality exactly what i needed.


RE: Copying data from HTML to Excel - ravi.gajul - 11-03-2011

Hi Santhosh,
Ankesh's code will give you innertext ...i.e...it will not display the tags(td,tr,br's).

Regards,
Ravi