Micro Focus QTP (UFT) Forums
Setting a html path to a variable - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Setting a html path to a variable (/Thread-Setting-a-html-path-to-a-variable)



Setting a html path to a variable - mv8167 - 09-29-2011

I have two pathways that I am trying to use when searching for a dialog box

Code:
If Browser("Preferences").Page("Preferences").WebElement("close_window2").Exist(0) then
    BrowserPath = Browser("Preferences").Page("Preferences")
Else
    If Browser("name:=Preferences","CreationTime:=1" ).Page("title:=Preferences").WebElement("html id:=btnClose").Exist(0) Then
        BrowserPath = Browser("name:=Preferences","CreationTime:=1" ).Page("title:=Preferences")
    Else
                Msgbox "Browser Path Not Found"
    End If
End If

With BrowserPath
……

This is of course not working. Can I set a variable name to a path as I have indicated above (thus to use in a With statement)?


RE: Setting a html path to a variable - rajpes - 09-29-2011

Code:
[b]set[/b] BrowserPath = Browser("Preferences").Page("Preferences")



RE: Setting a html path to a variable - mv8167 - 09-29-2011

Thx, after all of my digging I finally found out why my Browser("Preferences").Page("Preferences") was not working, lol, here it comes; My Local OR had a duplicate Browser("Preferences").Page("Preferences") ... which was different than in my own IA.tsr file. Thus the Local OR was being used while I was changing my IA or.

Arggggggghhhhhhh!

I ussually flush/delete/etc my local OR, my bad.

lol

thx everyone.

Lor