Forum Discussion

SJ1's avatar
SJ1
Occasional Contributor
6 years ago
Solved

Unable to handle the error using the script: "Unable to find the object"

Hi, I am trying to automate oracle forms application.   The script I have written searches for the window object. If its found, it logs "window found" else it should say "not found". Btw, i am st...
  • shankar_r's avatar
    shankar_r
    6 years ago

    Below approach is not recommended by many users but based on the flow this will work.

     

    function Window_NoResultsFound() {
        var noResultsFoundAlert = null;
        try{
            noResultsFoundAlert = eval(ReadObjectsFromXML.noResultsFoundAlert);
        }catch(ex){
            //if you want you can Log.erro here too
        }
        if (noResultsFoundAlert == null) {
            Log.Checkpoint("Window is not displayed as expected.")    
        } else {
            if (noResultsFoundAlert.Exists) {
                Log.Error("Windows is displayed");
            } else {
                Log.Checkpoint("Window is not displayed as expected.");
            }
        }
    }