QTP and dynamic links - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions) +--- Thread: QTP and dynamic links (/Thread-QTP-and-dynamic-links) |
QTP and dynamic links - jnaneswari - 04-17-2012 Hi guys I want 2 know how to work with QTP dyanamic links.Can u pls help me out RE: Hi - avinash_learnqtp - 04-17-2012 using description programming with regex or index RE: Hi - sshukla12 - 04-17-2012 Hi, Best way to deal with dynamic links is to use DP with your programing skills. Regards, Sankalp RE: Hi - Shridevi.Salagare - 04-20-2012 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 RE: QTP and dynamic links - kallem rajender - 04-27-2012 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 RE: Hi - supputuri - 05-29-2012 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 |