Write code for ,We have a web table with rows and columns like
EmpID EName Action
1 ABC Edit Delete
2 XYZ Edit Delete
3 PQR Edit Delete

In the above Table the last column has two links we have to click first link based up on EmpID =2

Answers were Sorted based on User's Feedback



Write code for ,We have a web table with rows and columns like EmpID EName Action 1 ..

Answer / mogal

RC = Browser("Browser name").Page("Pagename").webTable("TableName").RowCount
CC = Browser("Browser name").Page("Pagename").webTable("TableName").ColumnCount(1)
for iLoop = 1 to RC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(iLoop,1) = 2 Then
Rnum = iLoop
Exit for
End if
Next
for jLoop = 1 to CC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(1,jLoop) = "Action" Then
Cnum = jLoop
Exit for
End if
Next
Set ReqLink =Browser("Browser name").Page("Pagename").webTable("TableName").childItem(Rnum,Cnum,"Link",0)
ReqLink.Click

Is This Answer Correct ?    1 Yes 0 No

Write code for ,We have a web table with rows and columns like EmpID EName Action 1 ..

Answer / mogal

RC = Browser("Browser name").Page("Pagename").webTable("TableName").RowCount
CC = Browser("Browser name").Page("Pagename").webTable("TableName").ColumnCount(1)

Rnum = Browser("Browser name").Page("Pagename").webTable("TableName").GetRowWithCellText(2)
for jLoop = 1 to CC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(1,jLoop) = "Action" Then
Cnum = jLoop
Exit for
End if
Next
Set ReqLink =Browser("Browser name").Page("Pagename").webTable("TableName").childItem(Rnum,Cnum,"Link",0)
ReqLink.Click

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

How to parameterize a text field and the same field as combo field on next page. Means inserting values in Text field will appear in the combo field. for example country name, state name. Kindly reply it is urgent !!!

1 Answers   Adobe,


WHAT ARE THE DISADVANTAGES OF SHARED REPOSITORY?

9 Answers   BirlaSoft,


How to import excel sheet to QC?

1 Answers  


How to get Traceability matrix from TD?

0 Answers  


I am not able to record yahoomail browser.its giving error like "The browser Application can't be launched .Posssibly the URL is wrong" So anyone can tell me what setting i have to do in qtp??

1 Answers  


Name the properties you would use for identifying a browser and page when using descriptive programming?

0 Answers  


how you have used object libraries? plzzzzz do answer

1 Answers  


in qtp wha t is synchronisatin pt,what is the maximam time out

3 Answers  


Explain about invoking of application?

2 Answers  


what is objectidentification?

2 Answers  


Under what conditions would you recommend QTP for future projects?

1 Answers  


Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

0 Answers  


Categories