Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check specific links of a webpage
#1
Not Solved
Hi All,

How to check specific links of a webpage are working or not.


Let say in https://www.google.co.in/webhp?hl=en , header has links Gmail ,Images and Footer has links Advertising,Business,Account. Then how to check all the links are working or not using VBScript , QTP.

How to create description objects and get to that link and check the links are working or not.
Reply
#2
Not Solved
Step 1:
Create description of the links

Step 2:
Identify all the links in the page.

Step 3:
Keep for loop and inside the the for loop keep if cond and check whether the link exists. if exists click and write exit for. else fail.

snippet:

Code:
dim objlink
set objlink = description.create
objlink("micclass").value = "Link"
set objlinkcoll = Browser("Name:=.*").page("Title:=.*).childobjects(objlink)
'Msgbox objlinkcoll.count


for i=0 to objlinkcoll.count

'check ur link exists in loop

if (trim("abc") = objlinkcoll(i) then

objlinkcoll(i).click

exit for

else

print "fail"

Next
///Hope this works
Happy scripting
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question How to open IE/Chrome/Firefox with a specific size? DarkestAmadeus 0 2,062 07-19-2018, 05:38 AM
Last Post: DarkestAmadeus
  webpage WinObject has same name Ananthakumar_S 0 1,736 11-30-2016, 09:48 PM
Last Post: Ananthakumar_S
Exclamation How to verify whether pdf is completely loaded or not in webpage nmakkena 1 2,749 08-27-2014, 04:09 PM
Last Post: vinod123
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,350 05-15-2014, 05:30 PM
Last Post: vishnu1067
  Comparing webtable data with weblist and webelements in other webpage arnav 1 5,864 04-18-2014, 10:01 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)