Micro Focus QTP (UFT) Forums
hard reading 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: hard reading variable (/Thread-hard-reading-variable)



hard reading variable - stevol - 06-03-2008

Hi,
in the following code:

Code:
Dim brow, pag, webuser, webpwd, loginlink, weblogin, dial1, winbutt1
Set brow     =Browser("name:=Vodafone")
Set pag      =brow.Page("title:=Vodafone")
Set webuser  =pag.WebEdit("name:=username","html tag:=INPUT","type:=text","index:=0")
Set webpwd   =pag.WebEdit("name:=password","html tag:=INPUT","type:=password","index:=1")
set loginlink=pag.Link("innertext:=login")
Set weblogin =loginlink.WebElement("innertext:=login")
Set dial1    =brow.Dialog("text:=Avviso di protezione","nativeclass:=#32770", "is owned window:=True", "is child window:=False")
Set winbutt1 =dial1.WinButton("text:=&Sì", "nativeclass:=Button", "visible:=true")

when I run the code, for the last 2 objects there is a reading much slow of the objects in comparison with the others. Is there an explanation about this?
thanks for every suggestion

Edit: Please format your code, I have done it for you this time. You can use # button on top, while posting a new message -- Ankur


RE: hard reading variable - Ankur - 06-03-2008

As I have mentioned earlier, DP at times is slower than OR method...check out earlier threads for more info.


RE: hard reading variable - Anshoo Arora - 06-04-2008

But, what are you running? All I see there are some object references. That code will not perform any action on your AUT.

See if this helps:

Code:
Set oBrowser = Browser("micclass:=browser")
Set oPage = Page("micclass:=Page")
Set UserName = oPage.WebEdit("name:=username", "index:=0")
Set PassWd = oPage.WebEdit("name:=password", "index:=1")
Set LoginLink = oPage.Link("innertext:=login")
Set oDialog = oBrowser.Dialog("text:=Avviso di Protezione")
Set btnSi = Browser("micclass:=Browser").Dialog("text:=Avviso di Protezione").WinButton("text:=&Sì")

Try to use only the properties that are enough to uniquely identify the object. Also, while you at it, can you double check the WinButton's text property again?


RE: hard reading variable - stevol - 06-05-2008

hi,
thanks for suggestion, but the reading speed during the run is the same (howewer, no problem... it was only a curiosity)