GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 46 of 674    Print  
How can we program using QTP to generate a text file which has data inside in a particular format which also needs to be programmed using QTP ?

  
Total Answers and Comments: 1 Last Update: October 10, 2006     Asked by: ashish 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: rachana
 

Dim fso, fhdl, msgstr '  variale to manipulate filesystem object , file handle , 'message details to be logged

  

 msgstr =  "TestCycle Date/Time -->" +cstr (date)& " - " & cstr(Time) & NewLine &_
        "TestScript Name " +  " APA_AdminLogincheck" & NewLine &"TestCase Id 00003" & NewLine &_
          "Details :  " &errstr1 & NewLine & "Result--> "  +  "Pass" & NewLine &_
         NewLine & "---------------------------------------------------------------------"  & NewLine  ' data inside the file is passed as parameter

   'create and open the file object
Set fso = CreateObject("Scripting.FileSystemObject")
Set fhdl = fso.OpenTextFile("c:Log.txt", 8)


' write to log file
fhdl.write(msgstr)

fhdl.close()

try this script. the format is defined through msgstr variable. You can modify according to your requirements



Above answer was rated as good by the following members:
baji.mohammed
October 10, 2006 04:17:33   #1  
rachana        

RE: How can we program using QTP to generate a text fi...

Dim fso fhdl msgstr ' variale to manipulate filesystem object file handle 'message details to be logged

msgstr TestCycle Date/Time --> +cstr (date)& - & cstr(Time) & NewLine &_
TestScript Name + APA_AdminLogincheck & NewLine & TestCase Id 00003 & NewLine &_
Details : &errstr1 & NewLine & Result--> + Pass & NewLine &_
NewLine & --------------------------------------------------------------------- & NewLine ' data inside the file is passed as parameter

'create and open the file object
Set fso CreateObject( Scripting.FileSystemObject )
Set fhdl fso.OpenTextFile( c:Log.txt 8)


' write to log file
fhdl.write(msgstr)

fhdl.close()

try this script. the format is defined through msgstr variable. You can modify according to your requirements


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Hi I am new to load testing .Currently i am using Load runner 8.2. i have recorded a script for login screen with some UID/PWD.In load runner Controller i have selected 100 Vusers,and i the run script.My question is :1.)Is the same script runs 100 times for same UID/PWD what i have entered during Recording.2.)If my data base contains only 50 users.Selecting 100 Vusers is a valid case?.3.)If i have selected 100 Vusers,is it necessary to enter 100 UID/PWD.Regards,vivek
Read Answers (8) | Asked by : vivek

In Quick Test Pro 8.21. While Recording/writing the Script i want to know the " Selecting Tab Position Action Script".Eg: Window contains 4 tab positions i would like to select 2 tab position at that time how script will come. plz write the script and send me. 2. How can i generate and select Tree View in Programatically. Eg: Mycomputer Contains all drives information like as below. +My Computerwhen i press + Symbol My Computer will Expand that format like-- My Computer Drive

I have 10 Edit Boxes in my application. i Named them as Text1, Text2, Text3...Text10. Now i want to set values in these Text Boxes using Loop Statement. Can i Usefor i=0 to 10 browser("b1").page("p1").WebEdit("Text" & i).set "value" &inext**********Is it acceptable WebEdit("Text"&i) ? I am getting error here.Any suggestions?
Read Answers (6) | Asked by : Nagelli Anil Kumar

Latest Answer : In QTP 9.2, there is an option to export to XML filefrom Object repository manager, File-> Export to XML option is there.Is this what you wanted or something elseRegards,Meena ...
Read Answers (3) | Asked by : Nagelli Anil Kumar

In the mortgage business certain activity must take place within a specific number of business days from the loan origination date. The purpose of this assignment is to develop a function that will calculate the business date ‘x’ number of days from a specific start date. For example: 10 Business days from August 25th, 2003 is September 8th, 2003.This function is to have a two input parameters, consisting of the start date in the format mm/dd/yyyy and the number of days to advance.

I am testing an application that sends certain data to users. How do i check that the user will not receive excess data. I mean I can go in and sign in as the user and insert a standard checkpoint...but that only checks the data integrity, it does not check if the user received excess data. Please help..any suggestions are welcomed
Read Answers (2) | Asked by : Raj

How do we automate the process of editing an XML file. coz if i just record opening an XML file making changes and saving.and when i run this simple recording some other field gets edited in the run process.please help and let me know know what should be done to automate XML files???
Read Answers (1) | Asked by : charm

How can we program using QTP to generate a text file which has data inside in a particular format which also needs to be programmed using QTP ?
Read Answers (1) | Asked by : ashish

I want to use QTP to test web application. in that application there is one menu like file and under that there are diff menus like create, new,open etc. so while recording if i click on new then it get recorded. but in new when i click on new then its not get recorded. why this is happening?
Read Answers (6) | Asked by : madhavi

Can anybody tell me the purpose of output checkpoints in QTP. how u r testing the text data through text checkpoints. how u r testing text data in the webpage through parameterization. my application is web based application. my requirement is i am retriving the data from the database to webpage. i put text checkpoint on the text, but problem is the parameterization. can anybody help me with code. i will appreciate if anybody can say
Read Answers (4) | Asked by : manoj_k3


 Sponsored Links

 
Related Articles

Breaking up XML into Relational Data

Breaking up XML into Relational Data While the preceding example shows how to construct an XML representation over relational data the example in this section illustrates how you can shred XML data back into relational data This reverse operation can be useful if your application works with relation
 

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Retrieving XML Data

Retrieving XML DataTo retrieve XML data from an XMLType table you can use a SELECT SQL statement just as you would if you had to query a relational table For example to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section you might issue the
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

ODP.NET - Techniques to Improve Performance while Retrieving Data

ODP NET Techniques to Improve Performance while Retrieving Data Performance tuning is a great subject in Oracle Volumes of books would not be enough to cover every aspect of performance tuning in Oracle However in this section we will only discuss the fundamental performance techniques while working
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

ODP.NET - Retrieving Typed Data

ODP NET Retrieving Typed Data While retrieving values from OracleDataReader we can extract information available in individual columns of a particular row either by using column ordinal position values or column names mosgoogle Retrieving Typed Data Using Ordinals ODP NET provides data specific enum
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape