Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check visibility of an Object
#1
Not Solved
Hi All,
Please help me to resolve my following problem.
On my application I have an Object(Next button), its always available on the page in visible or hidden mode.
Now if I put the condition:
Code:
if browser().Page().WebButton().Exist then
    browser().Page().WebButton().Click
Else
Reporter.ReportEvent micFail, "Next button not exist", "Fail"
End If

but my first condition is always true and QTP always click Next button even though its in hidden mode.

I dont want to click this button when its in hidden mode, Please can you tell me how can I resolve my this issue.

Thanks All,
Reply
#2
Not Solved
Hi Ritu,

Try adding one more description property for identifying button - 'visible' into repository or you can use descriptive programming for this.
create object for button and use it

Code:
Set oButton = Description.Create()
oButton("Name").Value = "Next"
oButton("html tag").Value = "Input"
obutton("Visible").Value = "True"
Browser().Page().WebButton(obutton).Exist

Reply
#3
Not Solved
This is a nice question Ritu.

Exist will fail here because even though the object is not visible on the screen it is present inside the DOM and as you may know, QTP takes object from the DOM. To check for this I would advise you go to inside DOM using .object notation and check for display:none property.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#4
Not Solved
Hi Ankur,
Thanks a lot for quick reply.
Yes. I know about DOM and that QTP pick objects from DOM.

But can you plz tell me syntax how to use this display:none property.
Regards,
Reply
#5
Not Solved
Please try it once on your own, let us know the EXACT problem you faced while using .object notation and then we will provide help. We generally don't encourage giving direct answers on this forum.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to force QTP to Check for trigger through Recovery Object ? Sumit Maru 0 3,203 02-21-2011, 02:44 PM
Last Post: Sumit Maru
  Check if the Object is Empty/Null manojith1984 1 13,361 05-20-2009, 10:44 AM
Last Post: manojith1984
  QTP 9.5 Object Repository merge tool not merging the Check Point objects govqa 0 3,302 05-18-2009, 07:11 PM
Last Post: govqa
  How to check an object is NOT there? alecjcook 2 3,248 05-13-2008, 02:10 AM
Last Post: niranjan

Forum Jump:


Users browsing this thread: 2 Guest(s)