Micro Focus QTP (UFT) Forums
Checking Some Fields in a website - 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: Checking Some Fields in a website (/Thread-Checking-Some-Fields-in-a-website)



Checking Some Fields in a website - PrabhatN - 03-22-2010

Hi,

I am automating a website and there I need to check whether some specific fields (WebEdit,WebList,WebCheckBox) appear when a link is clicked and all disappear when the link is clicked again.

I hav added all the fields to the Object Repository.I hav written the following code to check the link works properly.
Code:
Browser("").Page("").Frame("").Link("").Click
Browser("").Page("").Frame("").WebEdit("").CheckProperty visible,True,20000

Browser("").Page("").Frame("").Link("").Click
Browser("").Page("").Frame("").WebEdit("").CheckProperty visible,False,20000


The problem in doing so is when I am clicking the link all fields are visible and property "visible" has value "1",but while clicking the link again all the fields are getting disappeared but the 2nd checkpoint is failing because the "visible" property still retains value "1"

I think Descriptive Programming is the only way it can be done with...

Can anybody suggest me something on that ?


RE: Checking Some Fields in a website - jsknight1969 - 03-25-2010

Try using:
Code:
if lcase(Browser("").Page("").Frame("").WebEdit("").Object.style.display) <> "none" then
   'object is visible
else
   'object is hidden
end if

Since those objects are probably being hidden using javascript, it is the style that is changing not the tag property of visible.