Micro Focus QTP (UFT) Forums
objects sometimes recognized and sometimes not - 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: objects sometimes recognized and sometimes not (/Thread-objects-sometimes-recognized-and-sometimes-not)



objects sometimes recognized and sometimes not - bistritapcv - 04-12-2013

I am running QTP which opens a browser that has a place to enter login and password (similar to the flight demo). I added the boxes to the repository and put them into my QTP script (enter text in theusername box, enter text in the password box, and click login).

Sometimes when I run it it works fine.
Other times when I run it it says it can't find the objects (in runtime).
This happens with other objects to. A popup window somes up and
I can click buttons on it one time, and the next time the objects aren't
recognized.

In the case with the login, I don't know what is going on. Object spy seems to identify the objects, and the web site has not changed.

For the popup window one thing I noticed is sometimes an object is
called browser("xALIWeb").page("report") and then other times it might be called browser("xALIWeb").page("report_2") or even
browser("xALIWeb_2").page("report")

Why would boject names change like this? And what is happening with the login? It is only one page.


RE: objects sometimes recognized and sometimes not - Sathiya - 04-15-2013

Did you try with descriptive programming?
if not please try with that....
or else use regular expression for your objects and try.


RE: objects sometimes recognized and sometimes not - sshukla12 - 04-15-2013

HI,

Try to add the the objects in shared OR and call that OR in your test script.
Problem which u are facing of getting page name like report_2 is mainly when u used local OR.

Try the above and let me know if its work for u or not.

Regards,
Sankalp


RE: objects sometimes recognized and sometimes not - Saket - 04-15-2013

I dont think, its the issue of using Local OR, the same can happen even if you use Shared OR. It could be like the page url is getting changed and could be resolved by using regular expression in the OR, as pointed out by Sathiya.


RE: objects sometimes recognized and sometimes not - sshukla12 - 04-16-2013

Hi,

Kindly refer to the below provided url, this might help u understanding and resolving the issue.

https://www.learnqtp.com/forums/Thread-Page-element-keep-changing

Regards,
Sankalp