I am working on a web based application where sometimes it takes time to load the objects on the page.So, i am using wait for existence function to handle this thing.But in case if the object doesnot appear on the page, then this script will fail due to OBJECT NOT FOUND.I want to continue to the next lines of scripts even after this.Please tell me if we can handle this thing in RFT.
Intially i was using the below code to handle this thing.
But the above program will escape the if loop as the new button takes time to appear on the page and the script will treat it as "object does not exists" and will move to next script lines.However the new_button appear at late time ,so it miss the click action on the button.
So to resolve this thing i use the below piece of code.
//next script lines
But in this case if the new_button is not found then it will not execute the next lines and will fail at the same point.So please tell me if there is some solution to the above problem.
Basically depending on the browser you are testing you will need to figure it out when the page is completed (watch out that this is made differently from Mozilla, IE) then just put between a try catch and make sure to catch the ObjectNotFoundException and continue. This would be the easiest way of doing it
Did this try, catch block solution work for anybody? It would not work for me [img]/images/graemlins/frown.gif[/img] Even before the exception reaches to the catch block RFT pops up the objectnotfound window.
I read somewhere that we can override this objectnotfound window by extending the superhelper class and writing a method onObjectNotFound(). It was avoiding the objectnotfound window but the script would stop executing after that.
If anybody tried this please post the details here.
I tried using, try and catch blocks to handle the object not found exception. Before the exception is sent to the catch block RFT handles it and a object not found window appears. To solve this I have included below line in my script (found in the same forum).