Micro Focus QTP (UFT) Forums
Ajax Navigation - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: General (https://www.learnqtp.com/forums/Forum-General)
+--- Forum: Suggestions and Feedback (https://www.learnqtp.com/forums/Forum-Suggestions-and-Feedback)
+--- Thread: Ajax Navigation (/Thread-Ajax-Navigation)



Ajax Navigation - satya_251 - 11-11-2011

it is function which can be used for ajax navigation on a browser

Public Function navigate_to_PS(level1,level2,level3,level4,level5)
Dim oDescBrowser, oDescPage, oDescLink, oDescWebList, oDescButton, oDescWebEdit
'hard coding the start point.
Set oDescBrowser = Description.Create()
Set oDescPage = Description.Create()
Set oDescLink = Description.Create()
oDescBrowser("micclass").Value = "Browser"
oDescPage("micclass").Value = "Page"
oDescLink("micclass").Value = "Link"
'oDescLink("index").Value = 0
'Setting the title for Browser & Page
'oDescBrowser("index").Value = -1
oDescBrowser("hwnd").Value = Environment("Browser_hwnd")
oDescPage("hwnd").Value = Environment("Page_hwnd")
'With Browser("micclass:=Browser").Page("micclass:=Page")
With Browser(oDescBrowser).Page(oDescPage)
.WebElement("micclass:=WebElement","innertext:="&level1,"index:=0").Click
While .WebElement("micclass:=WebElement","class:=pthnavflyout pthnavbarshow").Exist(3) = false
Wend

If level2<> "" Then
.link("micclass:=Link","innertext:="&level2,"index:=0").Click
Wait(5)
End If

If level3<> "" Then
.link("micclass:=Link","innertext:="&level3,"index:=0").Click
Wait(5)
End If

If level4<> "" Then
.link("micclass:=Link","innertext:="&level4,"index:=0").Click
Wait(5)
End If

If level5<> "" Then
.link("micclass:=Link","innertext:="&level5,"index:=0").Click
Wait(5)
End If

End With

Set navigate_to_PS = Browser(oDescBrowser).Page(oDescPage)
End Function