Hi guys I want 2 know how to work with QTP dyanamic links.Can u pls help me out
QTP and dynamic links
|
using description programming with regex or index
Hi,
Best way to deal with dynamic links is to use DP with your programing skills. Regards, Sankalp
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
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
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 |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)