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

Why QTP is termed as a Record and Playback tool?

1 Answers  


Explain about Hybrid Framework

2 Answers   IBM,


if Object repository contain x and y properties. we do not know whether they are mandatory or assistive properties. While executing the script qtp will use both the properties or only sufficient properties to identify the object. It means it use OR (or) AND

8 Answers   ADP,


HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com

0 Answers  


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  






which is the easiest way you can send the QTP test results to Client if he want to see the screenshots when the results are failed?

1 Answers   CTS,


Where we write the FUNCTIONS, in Expert view (or) in any textfiles like Notepad and save it in Library functions folder? How to cal that functions to our script? How to save that functions to Function generator?

3 Answers  


How many types of recording facility are available in quicktest professional?

0 Answers  


When Object Repository is available what is the necessity of having Descriptive programming which needs more scripting efforts.

3 Answers  


how and what kind of vb functions do us ein QTP?

2 Answers   Ordain Solutions,


in howmany ways you perfrom batchtesting

6 Answers   Lehman Brothers,


In Test Director , You can store Test cases or vb Script . Why we need VSS?

2 Answers  


Categories