I am creating a script to be used for a website. The website has a main page which contains a link for another page (target page).
I am able to click the link using QTP however the Website is sort of unstable, If you click the link for target page sometimes it takes huge amount of time to load the target page (Or even fails to navigate to target page) If user clicks the link again while target page is loading the page loads quickly.
I wanted to place a work around for this using descriptive programming. Basically following is the thing I want to achieve
1. Click the link (for Target page) in Main page
2. Wait for 10-15 Sec and check if the target page is loaded
3. If the target page is loaded. Do nothing
4. If Target page is not loaded. Click the link again while the page is loading
5. Repeat steps 2-4 for 3 times

Can you please help me write a function for this?

Thanks in advance