In Datatable having the data like this

S.no Name Address
1 raj hyderabad
2 suresh Mumbai
3 shyam chennai
4 dev banglore

i want to get the shyam row id & column id using scipting
i.e 3,3

Answers were Sorted based on User's Feedback



In Datatable having the data like this S.no Name Address 1 raj hyderabad ..

Answer / pushkar1206

a=datatable.GetSheet("Action1").GetRowCount
For i=1 to a
b=datatable.GetSheet("Action1").GetParameterCount
For j=1 to b
datatable.GetSheet("Action1").SetCurrentRow(i)
If datatable.Value(j,"Action1")="shyam" Then
msgbox i
msgbox j
End If
Next
Next

Is This Answer Correct ?    1 Yes 0 No

In Datatable having the data like this S.no Name Address 1 raj hyderabad ..

Answer / pravati

rowcount=Datatable.getsheet(id).rowcount
for i=1 to rowcount
colmncount=Datatable.getsheet(id).getparametercount
for j=1 to colmncount
Datatable.getsheet(id).setcurrentrow(i)
if Datatable.value(j,shetid)="shyam"
then msgbox i
msgbox j
exit for
end if
next
if Datatable.value(j,shetid)="shyam" then
exit for
end if
next

Is This Answer Correct ?    0 Yes 0 No

In Datatable having the data like this S.no Name Address 1 raj hyderabad ..

Answer / shekhar

a=
Browser("Creationtime:=1").page("micclass:=page").webtable("html
Id:=ctl00_contplhDynamic_ZeroChaosGrid_ctl00").GetRowWithCellText("ATT",,2)

b=Browser("Creationtime:=1").page("micclass:=page").webtable("html
Id:=ctl00_contplhDynamic_ZeroChaosGrid_ctl00").ColumnCount(a)

For i=1 to b

If
Trim(Browser("Creationtime:=1").page("micclass:=page").webtable("html
Id:=ctl00_contplhDynamic_ZeroChaosGrid_ctl00").GetCellData(a,i))=Trim("ATT")Then

msgbox "The correct row and column no" & a &" , " & i

Exit for
End If

Next

Is This Answer Correct ?    1 Yes 2 No

In Datatable having the data like this S.no Name Address 1 raj hyderabad ..

Answer / crazy boy

'' this is to search Shyam row and col in the webtable

DataRow=Browser("title:=givevalue").page("title:=GiveValue").webtable("name:=GiveValue").GetRowWithCellText("Shyam")
msgbox DataRow

ColumnCount=Browser("title:=givevalue").page("title:=GiveValue").webtable("name:=GiveValue").columnCount(DataRow)

for i=1 to Columncount
Data=Browser("title:=givevalue").page("title:=GiveValue").webtable("name:=GiveValue").getcelldata(DataRow,i)
if Data="Shyam" then
msgbox DataColumn
exit for
end if
next

msgbox "The Value is available in Row-->"&DataRow &" and Column -->"&DataColumn

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

What is iteration? How it is related to Test Results in QTP?

2 Answers  


How to identify 2 versions of browsers based on regular expression

1 Answers   Cognizant,


Explain hybrid framework with advantages and disadvantages?

0 Answers  


What are the Latest Feature are added In QTP 9.2?

2 Answers   Infotech,


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,






What is operator in VB Script?

1 Answers   IBM,


how u write vb script in qtp pls give me some basic script and some material

32 Answers   Datamatics, UHG, Winit,


How to handle "Java Runtime error" popup window in the web application ? Sometimes the application throws the error repeatedly... Is there any browser setting available to disable the error ?

2 Answers   TCS,


Reverse string without mid or streverse function.

1 Answers   Deloitte,


How will you check that your test cases covered all the requirements?

0 Answers  


How you can find length of array in qtp?

0 Answers  


Mention the different actions types of qtp.

0 Answers  


Categories