Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18120 Posts in 4741 Topics- by 31743 Members - Latest Member: suuraj
 

Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Broken Links check    (Read 904 times)
niranjan deka
FRProject
Full User
*
Offline Offline

Posts: 226


« on: September 02, 2009, 03:54:54 AM »

Hi all,

Is there is any way that we can find all the broken links in a page uisng this Powerful Auto it tool.If possible, do let me know how can we achieve this.

regards
niranjan
Logged
Meir Bar-Tal
Administrator
Advanced User
*****
Offline Offline

Posts: 1283



WWW
« Reply #1 on: October 04, 2009, 11:41:40 PM »

After getting the links collection with _IELinkGetCollection you can probably traverse it and use _IELinkClickByIndex for each link with the flag that instructs the function to wait until the page loads. If there's a problem, a relevant error will be returned. On success, -1 will be returned.
Logged

Best Regards,

Meir Bar-Tal
AdvancedQTP Chief Editor & Forums Administrator
niranjan deka
FRProject
Full User
*
Offline Offline

Posts: 226


« Reply #2 on: October 05, 2009, 12:57:41 AM »

Hi,

Thanks a lot for you reply. I have tried the same for a site 'http://mindprod.com/application/brokenlinks.manual.html#SAMPLEHTMLEXPORT' where the link number 31(index) also return -1(Success)But in reality it should return 0 or error code because page is not found for the same. Below is my used code:

----Code---------
#include <IE.au3>
$oIE = _IECreate ("http://mindprod.com/application/brokenlinks.manual.html#SAMPLEHTMLEXPORT")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended

MsgBox(0, "Link Info", $iNumLinks & " links found")

;For $oLink In $oLinks
 ;  MsgBox(0, "Link Info", $oLink.href)
;Next

$s=_IELinkClickByIndex ($oIE, 31)

MsgBox(0, "Link Info", $s)
--End----------------------------

regards
Niranjan
Logged
Pages: [1]   Go Up
Print
Jump to: