05 November 2017

Finding broken links using UFT ( 2 different ways )

Option 1:

Set wr = createobject("WinHttp.WinHttpRequest.5.1")
    wr.Open "GET""http://www.google.com"
    wr.Send
RStat = wr.Status

msgbox RStat

'If RStat returns 200, Link is active


Option 2:

Set obj = createobject("Msxml2.ServerXMLHTTP")
    obj.open "GET""http://www.google.com"
    obj.send
OStat = obj.status

Msgbox OStat

'If OStat returns 200, Link is active

No comments:

Post a Comment

AOM - Automation Object Model

'Creating QuicTest Object Set  qtapp =  createobject ( "QuickTest.Application" ) 'Launching the Application If  qtapp...