Micro Focus QTP (UFT) Forums
WebElement disappears on change of focus - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: WebElement disappears on change of focus (/Thread-WebElement-disappears-on-change-of-focus)



WebElement disappears on change of focus - EGBELL - 01-05-2015

I am using Win7 64 bit, UFT 12.01, and ALM 11.52. This problem also was encountered in QTP 10 and 11.0.

I am writing a test for an application that starts with a search for records for editing. It can accept one of several different parameters or sets of parameters. After clicking search, a check for validity of parameters or proper credentials to edit the specified record exists. If any of these returns with an error, that is reported in a web element. I need to be able to read the inner text of this web element to report why the test failed, or to compare against a list of specified strings to indicate that the expected error was indeed returned. My problem is that when focus changes, the web element disappears. This focus change seems to occur whenever UFT attempts to read the object. I may be misidentifying the exact sequence of events that occurs behind the scene, but the net effect is the same. When I try to read the runtime property of the web element, it disappears. Can anyone direct me to where I can learn how to read this web element without triggering the event that destroys the web element?

Thank you!