Micro Focus QTP (UFT) Forums
How to create a test that opens mutliple web 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to create a test that opens mutliple web links (/Thread-How-to-create-a-test-that-opens-mutliple-web-links)



How to create a test that opens mutliple web links - temssd - 10-05-2010

Hi all,

I am quite new to this program and getting to know it day by day.

I am trying to create a script that requires me to click on several links to see if they are up and running.

when i start recording, it prompts me to start by opening a site, if i do it this way, i then go into my favourites and click on each other link i need to access.

but when i run the test, it also goes into my favrourites and accesses the links this way as well.

The issue I have with this is, if one of my colleagues wants to run the test, then they will not be able to because they don't have the same favourites as I do.

I can send everyone my favourites folder and get them to save this in their favourites but I was hoping that QTP should have an option that saves each link in the test so you don't need to have these favourites.

If someone can shed some light on this, it would be greatly apreciated.

I'm sure someone else has created a thread about this but i couldnt find a anything when searching for it, so i am sorry if there is one already created about this.

Thanks


RE: How to create a test that opens mutliple web links - cdesserich - 10-05-2010

If you have your browser captured by recording, you can just click on the Expert View tab and type something similar to:
Code:
Browser("<Browser Name>").Navigate "www.google.com"
Browser("<Browser Name>").Sync

Replace the "<Browser Name>" portion of the code with whatever the name of your browser is that was captured when you started recording and replace the URL with the URL you want the browser to go to. Then repeat the statements in the script as many times as you need it. The "Sync" function tells the script to wait until the page finishes loading before moving to the next step. click here for a nice intro to QTP. Hope this helps.


RE: How to create a test that opens mutliple web links - Pallavii - 10-05-2010

You mean, you want to open each & every link and test if it is working or not..? If so, you can do it as below:

Code:
SystemUtil.Run "iexplore.exe", "<your URL>"            ' This will launch your URL in IE
Browser("<url browser name>").Click
Browser("<url browser name>").Close

You can try the above lines of code, for all the links you want to launch.

-Pallavi