Topic
1 reply Latest Post - ‏2009-07-09T21:24:32Z by SystemAdmin
zariftech
zariftech
1 Post
ACCEPTED ANSWER

Pinned topic RQM does not recognize try/catch command in RFT

‏2009-07-09T19:33:22Z |
HI,
I was trying to run RFT test scripts from RQM but eveyrtime I try to use my script it fails. I have pinpointed the problem....it always fails in this step:
try{
link__heleo().click();// the code you want to try
}catch (ObjectNotFoundException e){
logInfo ("An ObjectNotFound Exception has occurred. Exception: "+e.getMessage());
}
{sleep(20.0);
// code that must be executed whether an exception is received or not.
}

Seems like it does not recognize the Try/Catch steps.
Does anyone know why? Thanks in advance.
Updated on 2009-07-09T21:24:32Z at 2009-07-09T21:24:32Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    475 Posts
    ACCEPTED ANSWER

    Re: RQM does not recognize try/catch command in RFT - finally block wrong

    ‏2009-07-09T21:24:32Z  in response to zariftech
    Your finally block is wrong. You have omitted the finally keyword between the ending catch block and the beginning finally block.

    http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html

    
    
    
    try 
    { 
    //...(statements);... 
    } 
    
    catch (FileNotFoundException e) 
    { 
    //...(statements);... 
    } 
    
    finally 
    { 
    //...(statements);... 
    }