Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to click on all links dynamically in UFT?
#4
Solved: 8 Years, 6 Months, 3 Weeks ago
This is exact code that works for any page in capturing all the link urls to the data table. By clicking on all the links dynamically.


Code:
Set oBrowser= Description.Create()
oBrowser("micclass").Value = "Browser"
set oPage = Description.Create()
oPage("micclass").Value = "page"

set Links = Description.Create()
Links("micclass").Value = "Link"
set objLinks = Browser( oBrowser).Page( oPage).ChildObjects(Links)
LinkCount = objLinks.Count
msgbox LinkCount


For i = 0 To LinkCount-1
set Links = Description.Create()
Links("micclass").Value = "Link"
set objLinks = Browser( oBrowser).Page( oPage).ChildObjects(Links)
  objLinks(i).Click
datatable.SetCurrentRow(i+1)
datatable("Lname",global)=Browser( oBrowser).Page( oPage).GetROProperty("href")
Browser(oBrowser).Back
set objLinks=nothing       
Next

Thanks all.
Reply


Messages In This Thread
RE: click on all links dynamically.. - by Jay - 04-14-2011, 11:07 AM
RE: click on all links dynamically.. - by Rohan - 04-14-2011, 11:57 AM
click on all links dynamically.. - by Rohan - 04-14-2011, 01:18 PM
RE: click on all links dynamically.. - by Jay - 04-27-2011, 01:56 PM
RE: click on all links dynamically.. - by sindhus - 02-22-2016, 12:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to dynamically find the OracleFormWindow? arpan 0 1,866 04-26-2017, 12:45 AM
Last Post: arpan
Exclamation UFT doesn't recognize object in SAP at first, but recognize it after i click debug CedricMab 3 7,080 02-06-2017, 07:09 PM
Last Post: nguyen4685
  I want to click on all the links in the webtable. These links are nothing but some co abhideshpande001 0 2,750 07-22-2015, 09:36 AM
Last Post: abhideshpande001
  How to Verify Static Object Text which is changing Dynamically with Expected Result johnny77 0 3,420 06-25-2015, 11:32 AM
Last Post: johnny77
  SAPGuiSession get the active SAPGuiWindow dynamically cko77 2 5,599 01-27-2014, 12:04 PM
Last Post: cko77

Forum Jump:


Users browsing this thread: 1 Guest(s)