Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP and dynamic links
#1
Hi guys I want 2 know how to work with QTP dyanamic links.Can u pls help me out
Reply
#2
using description programming with regex or index
Reply
#3
Hi,

Best way to deal with dynamic links is to use DP with your programing skills.

Regards,
Sankalp
Reply
#4
One way of handling dynamic links is-
You can get the list of the links by using below code.

Code:
Set oListofLinks= Browser().Page().Object.GetElementsByTagName("A")


Then oLink object will have all the links.
Now use a for loop to get the exact link you want to operate.
Code:
'code For Each oLink in oListofLinks If oLink.innertext = (name of the link) Then oLink .Click() 'this is the req. link End If Next
Reply
#5
Hi

DDP(Dynamic Descriptive Programming) is the best in dealing any dynamic objects. Here the link object properties keep changing. So, what you can do is to create a DDP Object and need to write a code to handle this properties while running. We can add or remove any properties of any DDP Object. this way i hope you can handle dynamic links.
Kallem Rajender
Hyderabad
Reply
#6
Hi Shridevei,

It's one of the approaches that we can follow. But, can we think about the disadvantages of this code.
1) what if we don't have any links the page?
2) What if we have 5000 links on the page and I wanted to click on last link, how much time you are elapsing for the same?

why can't we create a child object with classname,htmltag and innertext/name so that we can directly identify directly if that particular link object does exist in the application or not. And then perform the action accordingly.

Thank You,
Sridhar
Thanks,
SUpputuri
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)