| || |
QTP performs required action on Webelement but script still throws error
There is a extjs web element in the application for which we are adding controls through object spy and then writing the necessary methods and events on these objects.
One of the lines we have is to click on the web element as below.
Browser ("Browser").page ("page").webelment ("webelement").click.
Here QTP is actually clicking on this webelemnt and continues with rest of the execution but if we analyze the results it says "object webelement" not found.
ofcourse I have added Error handling (On Error Resume Next) so the script would not stop. However what is strange is when its clicking the element and performing the requited steps why does the script still throw that error in the results?.
If you are getting "object webelement" not found error in your result reporting, then you must have reported it otherwise how it can be captured?
Has smart identification been invoked?
On Error Resume Next
Error happens here.
I think that an error occurred. QTP reported the error and then went on to the next line of code.
Maybe QTP clicked on the button, but thought that it did not work and reported the error.
Perhaps put in a break point after the .Click and examine err.number and err.description?
Something worth checking in that situation is if there are elements on a layers on top of your element. For example, one way of doing a fancy file upload button is to first create file input, and set it to 100% transparent, then underneath it, put a picture of a file upload button. Or another way of doing a fancy select that works on mobile and desktop the same way is to create a real select, on a layer below and set it invisible, then put some a layer on top of it with your custom rendered select, and do an event pass through to pass the selection to your real select.
It could have happened, if you patterned as below coding snippet
object.exist 'Probably the object doesn't seems loaded