If i entered 2 columns and 4 rows inputs in DDT Like Mango
fruit, Banana Fruit, Brinjal Veget, Carrot Veget.. . My Q
is How to get the 2nd column value for corresponding 1
column input in 3rd row ie, ( i need to get "veget" in
messge box @ run time

Answers were Sorted based on User's Feedback



If i entered 2 columns and 4 rows inputs in DDT Like Mango fruit, Banana Fruit, Brinjal Veget, Car..

Answer / satya

strCnt=DataTable.getRowsCount
For i=1 to strCnt
datatable.SetCurrentRow(i)
x=datatable.Value("A")
datatable("c")=x
Next

Is This Answer Correct ?    4 Yes 0 No

If i entered 2 columns and 4 rows inputs in DDT Like Mango fruit, Banana Fruit, Brinjal Veget, Car..

Answer / ratna

datatable.setcurrentrow(3)

x=datatable.value(2,1)

'datatable.value(2,1) where 2 is column name and 1 is sheet
no. ie., 1 is for global sheet

msgbox x

'output is veget

Is This Answer Correct ?    2 Yes 0 No

If i entered 2 columns and 4 rows inputs in DDT Like Mango fruit, Banana Fruit, Brinjal Veget, Car..

Answer / sampath

datatable.SetCurrentRow(3)
x=datatable.Value("A",1)
msgbox x
datatable.Value("c",1)=x
msgbox c

--------------------------------------
A c
mango
banana
brinjal
carrot

Is This Answer Correct ?    5 Yes 5 No

If i entered 2 columns and 4 rows inputs in DDT Like Mango fruit, Banana Fruit, Brinjal Veget, Car..

Answer / ravi

Ratna...Could u pls explain your answer

Is This Answer Correct ?    0 Yes 0 No

If i entered 2 columns and 4 rows inputs in DDT Like Mango fruit, Banana Fruit, Brinjal Veget, Car..

Answer / saff

i= inputbox "enter ur string" # say brinjal

r=datatable.getrowcount #get row count
for i=1 to r #loop till the end of the row
datatable.setcurrentrow(i)
aa=datatable.(a ,dtglobalsheet) # column 1 value into aa
if instr(aa,i,1)=1 #compare the strings
bb=datatable(b,dtglobalsheet)
msgbox bb
exit
else
i=i+1
next

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

What are the three challenges U faced during automation testing of your application.

2 Answers   L&T,


Hi friends, In a particular test how many maximum call to new actions we can call?It reusable or normal actions what ever it is .

1 Answers   AppLabs,


How you can write contexts to text file in qtp?

0 Answers  


what is the difference between function and subroutine ....here every one knows theoretically...here my QUESTION IS WHAT IS THE MEANING OF FUNCTION CAN RETURN A VALUE AND SUB CAN NOT RETURN A VALUE .....WHAT DOE'S IT MEAN FUNCTION CAN RETURN A VALUE HOW FUNCTION CAN AND SUB CAN'T ....GIVE A EXAMPLE FOR BOTH ....HOW IT CAN AND CAN NOT...HELP ANDY ONE....

1 Answers   HCL,


Can you tell me the differences between writing the VB script manually for a application and recording the same application in QTP , with a example?

1 Answers  






Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points

0 Answers   BirlaSoft,


What is diff betwee datatable.importsheet "path" and datatable.import

2 Answers  


Give me the Example of standard check point and text check point with syntax?

3 Answers   IMI Soft, IMI Soft Engineering,


There is one parent browser and 'n' number of child browsers on desktop. Write a code to close all the child browsers but parent browser should not be closed.

1 Answers  


Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.

0 Answers   IBM,


What are the limitations in using Virtual objects?

1 Answers   ITC Infotech,


What is the need and applications of learning VB script for a automation(QTP) engineer ain Realtime ?

2 Answers  


Categories