Micro Focus QTP (UFT) Forums
I am not getting links under a frame - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: I am not getting links under a frame (/Thread-I-am-not-getting-links-under-a-frame)



I am not getting links under a frame - deveshbhatt29 - 05-29-2014

I am not getting links under a frame
Ex. 2 frames are avaliable in Web page as like Top and middle. Total 12 Links are avaliable in Top Frame and no Links are available in middle frame. click on 1st link of top frame then 16 links are avaliable on middle frame and again I click on 1st link of middle frame then 2 frame are showing as like middle_Frame and List_Frame. 3 links are available on middle_Frame and 10 links are avaliable on List_frame. While i am running my QTP code then its check all links of top frame and navigate on last link of next frame but i want it to navigate on first link of top frame
QTP Code Here:
Code:
Set Frm_obj = Description.Create
Frm_obj("micclass").value = "Frame"
Set Lnk_obj = Description.Create
Lnk_obj("micclass").value = "Link"
Set Frm_Col = Browser("Title:=.*").Page("Title:=.*").ChildObjects(Frm_obj)
Frm_cnt = Frm_Col.count
ReDim MyArraryFrm(Frm_cnt)
Msgbox Frm_cnt
For i = 0 to Frm_cnt  -1
    a = Frm_Col(i).GetROProperty("name")
    MyArraryFrm(i) = a
    'Msgbox MyArraryFrm(i)
    Set Lnk_Col = Browser("Title:=.*").Page("Title:=.*").Frame("Name:="&MyArraryFrm(i)).ChildObjects(Lnk_obj)
    Lnk_cnt = Lnk_Col.Count
    ReDim MyArraryLnk(Lnk_cnt)
    msgbox Lnk_cnt
    For j = 0 to Lnk_cnt -2
'        b = Lnk_Col(j).GetROProperty("name")
'        MyArraryLnk(j)=b
        'Msgbox MyArraryLnk(j)
        sURL = Lnk_Col(j).GetROProperty("url")
        sText = Lnk_Col(j).GetROProperty("text")
        Print  sText  & "= "  & sURL
        Lnk_Prop = Lnk_Col(j).GetROProperty("name")
        MyArraryLnk(j)=Lnk_Prop
        Msgbox MyArraryLnk(j)
        Browser("Title:=.*").Page("Title:=.*").Frame("Name:="&MyArraryFrm(i)).ChildObjects(Lnk_obj)
        Browser("Title:=.*").Page("Title:=.*").Frame("Name:="&MyArraryFrm(i)).Link("Name:="&MyArraryLnk(j)).Click
    
    Next
Next



RE: I am not getting links under a frame - Ankur - 05-29-2014

Please don't open multiple threads for the same question. Format your code to get better responses here.