Pvkr this may not work in certain circumstances, say for example a Continue button is not recognised in a Click method where the Continue button takes you to the next page.
Now the next statement is to interact with an object on the new page but that object is not displayed as you are still on the previous page containing the Continue button. Thus all subsequent lines in the script interacting with the AUT will fail.
Thanks Guys for the help but as Mark pointed out am facing the same problem.
Mark, In my project when ever the new version is generated, there might be some new windows added in certain part of the application.
Now my requirement is that the test execution should continue even after an unexpected window appears. Is there any way that i can log that error and close that unexpected window for the old script so that the execution continues.