Hi
I am new to QTP. we are planning to implement automation
for the application.
I am trying to execute the following script:
Set ExcelObj=CreateObject ("Excel.Application")
ExcelObj.WorkBooks.Add
Set NewSheet=ExcelObj.Sheets.Item(1)
NewSheet.Name="Order"
ExcelObj.Cells(1, 1).Value = "Name"
ExcelObj.Cells(1, 2).Value = "Ordernum"
ExcelObj.Cells(2, 1).Value = "nam"
ExcelObj.Cells(2, 2).Value = "21"
ExcelObj.ActiveWorkbook.SaveAs "c:\test1.xls"
ExcelObj.Quit
Set ExcelObj = Nothing

in the above script for the line(ExcelObj.Cells(2, 2).Value
= "21")
it is inserting the value 21 successfully.this is fine
But if i want to insert a variable instead of the constant
value then what should be the modification in the script.

For example: If user retrives a value
throug "GetRoProperty" and wants to insert the value into
then how the script changes?



Hi I am new to QTP. we are planning to implement automation for the application. I am trying to ..

Answer / sri

Hi...don't mind...QTP Questions, u can post in Automation
Tools Section...this Section is only for Manual Testing!!!

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

what is the extension for the test version of the script?

5 Answers   TCS,


Approach for Installation,comaptibility,system testing

0 Answers   Diebold,


What is Descriptive Programing? In which cases, we will go for descriptive programing?

2 Answers   CTS,


How does QTP identifes the object in the application?

1 Answers  


Can u call winRunner scripts from QTP?

4 Answers  






How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks

0 Answers  


Can u call txt extension file in QTP?

2 Answers   Cap Gemini,


A FORM CONTAINS 5 FIELDS. 1 FIELD IS ENABLED REMAINING(4) FIELDS DISABLED. MY QUESTION IS ENTER VALUES INTO 1 FIELD AFTER THAT CLICK TAB BUTTON THEN 2 FIELD ENABLE THIS PROCESS CONTINUE UPTO 5TH FIELD. HOW TO WRITE CODE IN DESCRIPTIVE PROGRAMMING. PLZ TELL ME THE PROCEDURE AND CODE FOR IT.

0 Answers   TCS,


How to record application running on the Virtual machine?

0 Answers  


Hello Everybody, Please tell me can we create Test Plan in QTP? This I am asking irrespective to integrating with Test Director.I mean is there any option to create Test Plan in QTP itself. Thanks, Gaytri

4 Answers  


What is Port testing. Whhen will you perform?

0 Answers  


images are dynamically changes how to compare two images with out using the bitmap

0 Answers   Hexaware,


Categories