The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
Manuel_J
Member


Reged: 07/16/08
Posts: 45
Save Runtime DataTable to Default.xls
      #564268 - 04/21/09 03:23 PM

I would like to know how to write / update to DataTable during runtime and saving Default.xls. Currently I way I can think of is exporting DataTable to a different file, but this is not ideal.

Post Extras: Print Post   Remind Me!   Notify Moderator  
jbotash
Guru


Reged: 01/19/00
Posts: 2009
Loc: USA, CA
Re: Save Runtime DataTable to Default.xls [Re: Manuel_J]
      #564274 - 04/21/09 04:06 PM

[Assuming, you did not attach external Excel as your DataTable source]
If you write:

DataTable.Value(ParameterID [, SheetID])=NewValue

new value will go into Default.xls and
will be saved automatically when TC finishes.
Next time - it will appear in this Default.xls as you've set it.
No additional import\export is required.

(This is from QTP Help --> DataTable Object, Value Property)

Janna


Post Extras: Print Post   Remind Me!   Notify Moderator  
Manuel_J
Member


Reged: 07/16/08
Posts: 45
Re: Save Runtime DataTable to Default.xls [Re: jbotash]
      #564276 - 04/21/09 04:25 PM

Thanks for the reply. I did use your example but my Default.xls does not take the new values. Instead when I view results I can see the update when I view runtime DataTable.

Post Extras: Print Post   Remind Me!   Notify Moderator  
jbotash
Guru


Reged: 01/19/00
Posts: 2009
Loc: USA, CA
Re: Save Runtime DataTable to Default.xls [Re: Manuel_J]
      #564287 - 04/21/09 06:23 PM

OK. Let's try to Export data into Default.xls
[not into different file,
because you do not need that as you've said...]

As you know: Export Function in QTP works as 'SaveAs' and requires absolute full path to Excel file.
We do not need to hardcode path for our Default.xls.
It should be universal, compatible with any TC.
Right?
OK. We can BuiltIn QTP's Environment variable ["TestDir"]
to code this path.

Try:

Datatable.Export(Environment.value("TestDir") &"\Default.xls" )

Janna


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 54 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2443

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5