Sunday, November 21, 2010

ChildObjects - Click desired link

' Browser("iTKO LISA Functional Testing").Page("iTKO LISA Functional Testing").Link("Key Features").Click
Set oDesc = Description.Create()
    oDesc("micclass").Value = "Link"
 'oDesc("Class Name").Value = "Link"   
'Set Lists = Browser("iTKO LISA Functional Testing").Page("iTKO LISA Functional Testing").ChildObjects(oDesc)
Set Lists = Browser("iTKO LISA Functional Testing").Page("WAMP5 Homepage").ChildObjects(oDesc)
'Set Lists = Browser("iTKO LISA Functional Testing").Page("Internet Explorer cannot").ChildObjects(oDesc)
    NumberOfLists = Lists.Count()
 'msgbox NumberOfLists
 bVal = ""
For i = 0 To NumberOfLists - 1
    sVal = Lists.item(i).ToString()
 'msgbox sVal  ' return value like - [ xyz ] link
 startPos = Instr(1,sVal,"[")
 newVal = mid(sVal,startPos+1,len(sVal))
 endPos = instr(1,newVal,"]")
 endVal = mid(newVal,1,endPos-1)
 msgbox endVal
Next
'Browser("iTKO LISA Functional Testing").Page("Internet Explorer cannot").Link("More information").Click
'If endVal="test123" Then
'  msgbox endVal
'  Reporter.ReportEvent micPass,"Match Found","Success - Found the match"
'  Else
'   'Reporter.ReportEvent micFail,"Match Not Found","Fail - Match not found"
'    End If

No comments:

Post a Comment

 

©2010 Software Testing powered by Free Blogger Templates | Author : Anand Satish