Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child Objects method not fetching the count of links
#1
Hi,

Have written the below code to click on a link fetch the links under that webpage. where Site Search is a link name and trying to get all the links under Sitesearch page,with the below code.

lnknam="Site Search" 'passng thru a var as i got to parameterize the test

Code:
'Link Object Set alllink=description.Create alllink("micclass").value="Link" alllink("name").value=lnknam Browser("title:=.*","micclass:=Browser").Page("title:=.*").Link(alllink).Click Set lnk=Browser("title:=.*","micclass:=Browser").Page("title:=.*").ChildObjects(alllink) msgbox lnk.count

lnk count value is 1 n again results in Sitesearch, but i want to get all the Likns under SiteSearch webpage.Plz let me knw for any corrections in the above code.

Thanks in Advance
Shwetha
Reply
#2
Code:
set objLink=description.create objlink("micclass").value="Link" set obj=Browser("title:=Google.*).page("title:=Google").childobjects(objLink) msgbox obj.count
Reply
#3
This works fine but as mentioned i want to include Link Click first and then pass the link value and get count of the childobjects under that
Reply
#4
Hi,

Try to use the below code:

Code:
lnknam="Site Search" 'passng thru a var as i got to parameterize the test 'Link Object Set alllink=description.Create alllink("micclass").value="Link" alllink("name").value=lnknam Browser("title:=.*","micclass:=Browser").Page("title:=.*").Link(alllink).Click Set allink=Nothing Set alllink=description.Create alllink("micclass").value="Link" Set lnk=Browser("title:=.*","micclass:=Browser").Page("title:=.*").ChildObjects(alllink) msgbox lnk.count


Regards,
Sankalp
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,691 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  Driver Script to control child scripts sumanhyd 1 3,692 07-26-2016, 07:06 PM
Last Post: Ankesh
  UFT 12.50 unable to recognize child objects from a Dialog Class in Firefox jesusisaac 1 4,583 08-20-2015, 11:39 PM
Last Post: ADITI1992
  Child object shwetakondekar 0 2,448 07-01-2015, 03:28 PM
Last Post: shwetakondekar
  VB Script to count number of links in a web page. Suma Parimal 4 26,380 07-01-2015, 12:59 PM
Last Post: govind

Forum Jump:


Users browsing this thread: 1 Guest(s)