Hi friend
I have query regarding QTP datatable.
I want to insert data in datatable during runtime.

suppose i wrote

datatble.value(1) = "Test data"

so when i run the script it says column(1) doesn't exist.

Then i write something in column A1 manualy and run the
script again.

Now it works fine.

Pls clarify how i can put value in blank cell of datatable.




Answers were Sorted based on User's Feedback



Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / arun singh

first of all u have to change the column name.
i.e., double click on A and run the program.

got it.

Is This Answer Correct ?    10 Yes 3 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / rajaputra

Hi,
USE THIS,

datatable.getsheet(1).addparameter"Test",""
datatable(1,1)="Test Data"

Run and see the runtime datatable

Is This Answer Correct ?    7 Yes 2 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / medena

DataTable.GetSheet(1).AddParameter "Test",""
datatable(3,1)="Data Test1"
DataTable.SetNextRow
DataTable(3,1)="Data Test2"

Is This Answer Correct ?    7 Yes 2 No




Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / medena

I use this to fill the column with some values

Is This Answer Correct ?    4 Yes 1 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / sameer

=======
DataTable(ParameterID [, SheetID]) =NewValue This is what
is specified in data table help.

That means you should use:

DataTable.SetCurrentRow(1)
DataTable(1,dtGlobalSheet) = "Test" ...If you are to insert
data in the first row and first column of global sheet.

I am using the same...n it's working..

Is This Answer Correct ?    4 Yes 1 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / prashanth

Hi Friend,

Try this...

In the Datatable, in the first row, first column u can
find "A". DoubleClick on "A" and give any name like..."Test"

Now, in the Active Screen...

DataTable.Value("Test", Global)="Test data"

'Now if you want to use the value present in the datable,
in the script...

K=DataTable.Value("Test", Global)

Now, the value "Test Data" is stored in the variable "K"


Thanks,
Prashanth
prashanth.vikey@gmail.com

Is This Answer Correct ?    4 Yes 1 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / mercy

try putting datatable.value(2.1)="Test data". I have the
same prob...trying to resolve this the same way. will let u
know once done.

Is This Answer Correct ?    3 Yes 2 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / rajasekaran

By using Ouput Values concept we can insert in datatable
during runtime. but we can see the value only in Test
result,select runtime table in left side of he test results

Is This Answer Correct ?    2 Yes 2 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / sekhar

Hi friends,when we need to insert the values in to datatable
we can write script like

datatable("column name",sheetid)=value

Then the given value will be stored in desired sheet and
given column,

Is This Answer Correct ?    0 Yes 0 No

Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime..

Answer / siraj

Before inserting value in the cell, first we need to create
column by using "addparameter" then we can insert value in
that column.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer



More QTP Interview Questions

Why QTP is termed as a Record and Playback tool?

1 Answers  


How does QTP identifies the object in the application

6 Answers   Convergys,


How to add a runtime parameter to a data sheet?

6 Answers  


Hi, I Install QTP 9.2 in windows Vista. but it is not supporting IE. it is supporting only windows based application. could I change any setting in Vista for supporting IE.. ?? thanks in advance...

2 Answers  


Explain the keyword driven framework for the window based application complete creation of library files,env file,test data,recovery file,excel file ,repository etc and as a test engineer how is ur approach

0 Answers   AppLabs,






How software automation specialist enter steps in the Expert View?

0 Answers  


we have 10 actions in out test how can we convert 9th action is main action ? how ?

5 Answers  


What is the difference between QTP 8.2 and QTP 9.2 ?

4 Answers   IBM, Infotech,


Hi Everybody, Can anybody please tell me the how to display the result of the QTP in the notepad text file rather than in the QTP result window. Suppose this is my simple script:WHich will open the notepad file and enter some text and then will change the font then will calculate how much time has been taken.Now, in this script i want to display the result in notepad file. Dim s Dim starttimer,endtimer,timeit s="uyetuywqtywqte" SystemUtil.Run "notepad","","Y:\","" Window("Notepad").WinEditor("Edit").Type micCtrlDwn + "s" + micCtrlUp Window("Notepad").Dialog("Save As").WinEdit("File name:").Set "test1" Window("Notepad").Dialog("Save As").WinEdit("File name:").Type micReturn Window("Notepad_3").Type s Window("Notepad_3").WinEditor("Edit").Type micCtrlDwn + "s" + micCtrlUp starttimer=timer Window("Notepad_3").WinMenu("Menu").Select "Format;Font..." Window("Notepad_3").Dialog("Font").WinEdit ("Font:").Type "cou" + micDwn Window("Notepad_3").Dialog("Font").WinComboBox ("Font:").Select "Courier" Window("Notepad_3").Dialog("Font").WinEdit ("Font:").Set "Courier" Window("Notepad_3").Dialog("Font").WinEdit("Font:").Type micReturn endtimer=timer timeit=endtimer-starttimer print(timeit) Please also tell me where the function for the text file result will be declared and where it should be called. Thanks, Gaytri

2 Answers  


hi all, I want to know about the QTP scripts, i have read more books but all areis to be a theory so how can i improve my script skills. if anybody knows about qtp scripts plz guide me and i need a sample scripts.my mail id is karthis4u@gmail.com, 9986667831 If you all have any data send it to akadi111@gmail.com

3 Answers  


Can anybody give the script to addsheet, add column,add values under that column in the rows??

5 Answers   AZTEC,


plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   Wipro, TCS,






Categories