Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a test that opens mutliple web links
#1
Solved: 10 Years, 8 Months, 4 Weeks ago
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
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
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.
Reply
#3
Solved: 10 Years, 8 Months, 4 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Script to count number of links in a web page. Suma Parimal 4 24,735 07-01-2015, 12:59 PM
Last Post: govind
  what all you test when you migrate from client application to web application diya 4 3,055 04-29-2013, 09:04 AM
Last Post: basanth27
  Verify the order of web links bpetters 3 2,571 04-16-2013, 04:04 PM
Last Post: sshukla12
  How to test a Web page Monica Soneja 3 3,282 04-09-2013, 06:37 AM
Last Post: basanth27
  Web service automation:Error "could not create SSL/TLS secure channel" pranjalipalkar 0 2,533 01-16-2013, 11:40 AM
Last Post: pranjalipalkar

Forum Jump:


Users browsing this thread: 1 Guest(s)