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

Please mail me the license key of QTP 9.5 t v.sadangi@gmail.com ????? thx

0 Answers  


Can we Script any test case with out having Object repository? or Using Object Repository is a must

3 Answers   Crea,


Explain about import and export files?

1 Answers  


How do you know the location Id of an object if you know its index id?

0 Answers  


What is object repository?

3 Answers  






Tell me few important difference Between QTP and WinRunner?

9 Answers   TCS,


We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario

1 Answers   HK, TCS,


what difference between client and server applications exatly?

1 Answers   Honeywell,


What is object state in trigger events,in recovery scenario.write a script to handle this.

0 Answers  


Explain the concept of object repository and how quicktest professional recognises objects?

0 Answers  


There is a name "AJAY" how do u count no.of. "A" in that name ?

4 Answers  


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

2 Answers  


Categories