Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding a Link
#4
Solved: 11 Years, 4 Months ago
Hi Lorena,

Please see if below approach helps you:

Code:
For r = 2 to rNumber
'DocView
ReportType = ObjExcel.Cells(r,3)
'Href
Hreff = ObjExcel.Cells(r,4)
href_app=Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,4,"Link",0).GetROProperty("href")  'Use this approach if elements in the application are in same order as in the excel file otherwise use another loop For loop for table
name_app=Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,4,"Link",0).GetROProperty("innertext")

If href_app= Hreff and name_app=ReportType Then
    Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,2,"Link",0).Click
    Else
    Reporter.ReportEvent micFail, "Link is not present at appropriate position","Step Failed"
End If

Next

I doubt the way you are looping through excel because for looping through excel is done using "Usedrange".

An alternate way can be by importing the excel file into global sheet in qtp and then running the loop on datatable.

Regards,
Parminder
Reply


Messages In This Thread
Finding a Link - by mv8167 - 06-20-2011, 08:38 PM
RE: Finding a Link - by parminderdhiman84 - 06-20-2011, 11:02 PM
RE: Finding a Link - by mv8167 - 06-20-2011, 11:34 PM
RE: Finding a Link - by parminderdhiman84 - 06-21-2011, 11:21 AM
RE: Finding a Link - by mv8167 - 06-21-2011, 07:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation UFT is not finding object in runtime but able to locate the object from repository amar.vallapreddy 1 2,729 02-25-2014, 02:22 PM
Last Post: guin.anirban
  Finding the correct Link mv8167 2 4,424 01-24-2012, 07:58 PM
Last Post: mv8167
  Finding the correct WebTable mv8167 0 2,423 12-07-2011, 02:38 AM
Last Post: mv8167
  Finding Links with Paren's mv8167 10 7,563 09-27-2011, 02:46 PM
Last Post: Ankesh
  Finding WebElements mv8167 7 9,521 06-30-2011, 11:05 PM
Last Post: parminderdhiman84

Forum Jump:


Users browsing this thread: 2 Guest(s)