Micro Focus QTP (UFT) Forums
Intermitent "Object not visible" error - 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: Intermitent "Object not visible" error (/Thread-Intermitent-Object-not-visible-error)



Intermitent "Object not visible" error - erodpr - 01-12-2016

Hi All,

I have a problem with clicking a type "WebElement" object in a webpage on Google Chrome Version 47.0.2526.106 m with the HP Unified Functional Testing Agent installed.
It is the "Last" button on this navigation pane. 

[Image: 8Qw1AIl.png]

The object exists because it is entering my if statement that checks it, but intermittently shows an "Object not visible" error. Whenever it does run it just passes the line of code without clicking the object.
Code:
If Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").WebElement("Last_2").Exist(3) Then
   Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").WebElement("Last_2").Click
End If

[Image: O2SiTUF.png]

I have been stuck on this for a few days and have searched (including this forum), unsucessfully for a solution. 
THINGS I HAVE TRIED (and failed with):
-Putting both UFT and the Browser page on the same monitor (my main monitor)
-Using a dynamic object:
Code:
'Dynamic Object Creation
Dim LastDesc
Dim colNav

Set LastDesc = Description.Create
LastDesc("html id").Value = "theTable_last"
LastDesc("micClass").Value = "WebElement"

Set colNav = Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").ChildObjects(LastDesc)
colNav(0).Click
-Using .FireEvent("OnClick")

Please help. This is a very strange issue I've been dealing with. I appreciate any suggestions or solutions if you have them. Thanks in advance.


RE: Intermitent "Object not visible" error - vinod123 - 01-12-2016

Use the object and just get the object properties. Use GetROProperty method to get the properties of all the objects in combination of ChildObjects method


RE: Intermitent "Object not visible" error - erodpr - 01-12-2016

Thank you for your answer!

So I tried this:

Code:
'Dynamic Object Creation
Dim LastDesc
Dim colNav

Set LastDesc = Description.Create
LastDesc("html id").Value = Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").WebElement("Last_2").GetROProperty("html id")
LastDesc("micClass").Value = Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").WebElement("Last_2").GetROProperty("micClass")
'LastDesc("Visible").Value = "True"

Set colNav = Browser("ATH Móvil - F.A.M.A").Page("ATH Móvil - F.A.M.A").ChildObjects(LastDesc)
colNav(0).Click


and still got the Object Not Visible error. 

[Image: OuIbgSM.png]

Is this what you meant?


RE: Intermitent "Object not visible" error - vinod123 - 01-13-2016

Does that object is dynamic element if yes please reply it as i am checking dynamic object checking code


RE: Intermitent "Object not visible" error - erodpr - 01-13-2016

It is dynamic in the sense that the "outerhtml" paramater changes after it is clicked (one of the values inside the tag is changed to make the button disabled). That is actually what I am testing for.


RE: Intermitent "Object not visible" error - vinod123 - 01-14-2016

Get the innertext or innehtml or verify using abs_x which will change from object to object where you can verify the object.